andrewplummer / Sugar

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

Please add support for Indian English variant (en-IN) #646

Open jikamens opened 5 years ago

jikamens commented 5 years ago

One of my users would like to use en-IN as his locale and have date parsing work properly (i.e., parse dates as dd/mm rather than mm/dd). Right now SugarJS doesn't know about en-IN. Any chance of adding it?

andrewplummer commented 5 years ago

Hello sorry for the delay... actually if you simply set the locale to en-IN it should work. Sugar has en-US as the default (with many apologies), but has a workaround to ONLY parse nn/nn as mm/dd if the locale is explicitly en-US ... any other en- locale should parse as dd/mm.

jikamens commented 5 years ago

if you simply set the locale to en-IN it should work

Nope, it doesn't.

image

andrewplummer commented 5 years ago

Ok well damn... I think I was just hoping it would work that way...seems en-GB and en-AU only do that... I will add but as a workaround for now you can use en-GB.

jikamens commented 5 years ago

Yeah I already told him to do that. ;-)

andrewplummer commented 5 years ago

Ok cool.... I'll also add other commonwealth countries here like en-IE, en-NZ etc... however looking at it now it creates new objects in memory and I'd prefer to refactor to avoid that... anyway will look into it!