Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Return true or false based on whether the `lang()` did its job #1108
referenced this issue
Sep 17, 2013
Agreed. If the lang is found, it should return it. Otherwise return undefined.
It might also be nice to pass an array of languages in order of precedence:
var lang = moment.lang(['fr-ca','fr','en']);
This allows a fall-back strategy if the language is not found or installed.
I can see this being very useful when the language code is coming from some other system, and the caller isn't sure if the language will be allowed by moment or not.