PoiScript / orgize

A Rust library for parsing org-mode files.
https://poiscript.github.io/orgize/
MIT License
278 stars 34 forks source link

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

Closed calmofthestorm closed 7 months ago

calmofthestorm commented 4 years ago

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 commented 4 years ago

32 fixes this issue.

PoiScript commented 7 months ago

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