tinytime icon indicating copy to clipboard operation
tinytime copied to clipboard

feat: localization, add custom days and months

Open bjarneo opened this issue 8 years ago • 3 comments

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

bjarneo avatar Apr 29 '17 16:04 bjarneo

Since I get thumbs up, I will update the documentation, and revisit the code.

bjarneo avatar May 11 '17 06:05 bjarneo

@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 avatar May 16 '17 20:05 aweary

@aweary No worries. I haven't revisited the code or updated the docs ;)

bjarneo avatar May 18 '17 08:05 bjarneo

Maybe just close this one now. Been hanging for a while 😅

bjarneo avatar Mar 10 '23 05:03 bjarneo