I'm using moment.js with moment timezone in it.
I was trying to find how to get code 'fr'
from zone name 'Europe/Paris'
all day, but with no luck.
I read all their docs and couldn't find that function either, so i need help on this one.
Closest what i found is this. I need this function but in reverse, to pass country name and get country code.
Luckily i found solution
moment.tz.zone('America/New_York').countries()
This will get you array
so you guys can easily pass that value to locale()
So final code would be:
var get_locale = moment.tz.zone('America/New_York').countries();
moment.locale(get_locale);