Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement "date:[]" macro #371

Closed
manuelfuenmayor opened this issue Nov 4, 2020 · 3 comments
Closed

Implement "date:[]" macro #371

manuelfuenmayor opened this issue Nov 4, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@manuelfuenmayor
Copy link
Contributor

manuelfuenmayor commented Nov 4, 2020

In relation to metanorma/metanorma-bipm#38 (comment)

Implement date:[...] for localize date formats.

@manuelfuenmayor manuelfuenmayor changed the title Implement "date:[] Implement "date:[]" environment Nov 4, 2020
@manuelfuenmayor manuelfuenmayor changed the title Implement "date:[]" environment Implement "date:[]" macro Nov 4, 2020
@opoudjis opoudjis self-assigned this Nov 17, 2020
@opoudjis opoudjis added the enhancement New feature or request label Nov 17, 2020
@opoudjis
Copy link
Contributor

I don't regard this currently as high priority.

@ronaldtse ronaldtse moved this to Triage in Metanorma Nov 14, 2021
@ronaldtse ronaldtse moved this from Triage to Med priority in Metanorma Nov 14, 2021
@opoudjis opoudjis moved this from 🏕 Med priority to 🏔 High priority in Metanorma Apr 11, 2023
@opoudjis opoudjis moved this from 🏔 High priority to 🏗 In progress in Metanorma May 21, 2023
@opoudjis
Copy link
Contributor

opoudjis commented May 21, 2023

Format will be:

date:FORMAT[content]

where FORMAT is one of the accepted date format representations from strftime

Need to recover internationalised month and day names from twitter_cldr_rb, but it won't be easy, they are only present abbreviated in DateTime.now.localize(:ja).to_additional_s("E"/"MMM"). Can construct them from pure calendar:

TwitterCldr::Shared::Calendar.new(:de).months(:wide), TwitterCldr::Shared::Calendar.new(:de).weekdays(:narrow)

https://ruby-doc.org/stdlib-2.6.1/libdoc/date/rdoc/DateTime.html

https://github.com/twitter/twitter-cldr-rb/blob/afb5c20aa8eeb23926e78865bf205541974a7dd1/spec/shared/calendar_spec.rb#L55

Lookup via %-m and %a.downcase.to_i

Will map to: <date format="...." value="...." language="" script="" locale=""/>, which populates only in Presentation XML

opoudjis added a commit to metanorma/metanorma-model-standoc that referenced this issue Jun 1, 2023
opoudjis added a commit to metanorma/metanorma-model-iso that referenced this issue Jun 1, 2023
@opoudjis
Copy link
Contributor

opoudjis commented Jun 4, 2023

The format string needs an escape for space, since it must be a string without space. That escape shall be %_

The macro format is instead date:[VALUE], date:[VALUE,FORMAT], with %F as the default supplied format.

opoudjis added a commit that referenced this issue Jun 4, 2023
opoudjis added a commit to metanorma/isodoc-i18n that referenced this issue Jun 4, 2023
opoudjis added a commit to metanorma/isodoc-i18n that referenced this issue Jun 4, 2023
opoudjis added a commit to metanorma/isodoc-i18n that referenced this issue Jun 4, 2023
opoudjis added a commit to metanorma/isodoc that referenced this issue Jun 4, 2023
opoudjis added a commit to metanorma/metanorma.org that referenced this issue Jun 4, 2023
@opoudjis opoudjis closed this as completed Jun 4, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Metanorma Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants