Created
March 12, 2016 01:54
-
-
Save chris-martin/eeaa7444bcdd3cf0c3e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Moment.js doesn't have the particular locale-aware format string | |
* that we need here, so this is an ugly workaround to derive it | |
* from some related format strings that it does have. | |
* https://github.com/moment/moment/issues/2505 | |
*/ | |
function getMomentDateFormat() { | |
var localeData = moment.localeData(moment.locale()), | |
llll = localeData.longDateFormat('LLLL'), | |
lll = localeData.longDateFormat('LLL'), | |
ll = localeData.longDateFormat('LL'); | |
return llll.replace(lll.replace(ll, ''), ''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment