tinytime
tinytime copied to clipboard
feat: localization, add custom days and months
This is a PoC && haven't touched flow before.
Is this an approach that's acceptable?
As for the API, should it be a localization object, or should it be flattened to the pad level?
const render = template => tinytime(template, {
padMonth: true,
padDays: true,
padHours: true,
localization: {
months: ['januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'],
days: ['mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag', 'søndag'],
}
}).render(date);
https://github.com/aweary/tinytime/issues/7
EDIT: Should update docs
Since I get thumbs up, I will update the documentation, and revisit the code.
@bjarneo just wanted to let you know I haven't forgotten about this, just busy traveling currently. Will pull down and verify soon, but overall it LGTM 👍
@aweary No worries. I haven't revisited the code or updated the docs ;)
Maybe just close this one now. Been hanging for a while 😅