andrewplummer / Sugar

A Javascript library for working with native objects.
https://sugarjs.com/
MIT License
4.53k stars 306 forks source link

Date formating in "ru" locale. #622

Closed Costegillio closed 6 years ago

Costegillio commented 6 years ago

Greetings!

I have: Sugar.Date.format(new Date(), "{month}", "ru") > декабря

How can i get "декабрь" instead of "декабря", "сентябрь" instead of "сентября" and etc?

andrewplummer commented 6 years ago

Hi,

variants can be specified with numbers in the formatting tokens. In this case, {month4} will return what you want. Since all languages are different, there's not an overall applicable rule to the different types of tokens... it's easiest just to try them out for yourself.

Costegillio commented 6 years ago

Thanks, Andrew, your project is awesome.

andrewplummer commented 6 years ago

Hello... I'm considering a better system for Sugar's formatting tokens and I need your help! Could you please fill out this sheet for Russian? If you have any questions let me know! Thank you in advance!

Costegillio commented 6 years ago

Greetings!

Done.

andrewplummer commented 6 years ago

Awesome! Thank you!