orgize icon indicating copy to clipboard operation
orgize copied to clipboard

FR: Timestamps: Accept timestamps with missing/incorrect day of week (good beginner issue!)

Open calmofthestorm opened this issue 4 years ago • 1 comments

I'm going to start filing feature requests related to some of the work-in-progress code around timestamps, if that's all right, to help break down what is yet to be implemented into smaller chunks.

Org mode and org-element have robust support for timestamps that do not specify the day of week. It would be nice to implement this as well. So for example, [2020-01-01] should be accepted. Likewise, they will correct the day of week if you should have a timestamp where it does not match the numeric date.

The work here would be to update the parser (orgize/src/elements/timestamp.rs) to accept a missing day of the week (also note that per the spec, DAYNAME can contain any non whitespace-character besides +, -, ], >, a digit or \n.), and then to compute the day of week from the numeric value rather than storing it as a Cow string.

This would be a good issue for a beginner, provided they're familiar (or willing to learn) parsing with nom and chrono.

calmofthestorm avatar May 11 '20 22:05 calmofthestorm

#32 fixes this issue.

calmofthestorm avatar May 12 '20 21:05 calmofthestorm

this issue was fixed in v0.10.0-alpha.4.

PoiScript avatar Nov 19 '23 17:11 PoiScript