How to use the locale function from moment
Find comprehensive JavaScript moment.locale code examples handpicked from public code repositorys.
GitHub: medic/cht-core
22 23 24 25 26 27 28 29 30 31
$translate, SetLanguageCookie ) { 'ngInject'; return function(code, setLanguageCookie) { moment.locale([code, 'en']); $translate.use(code); if (setLanguageCookie !== false) { SetLanguageCookie(code);
185
408
53
2 3 4 5 6 7 8 9 10 11
let moment = require('moment'); require("moment/min/locales.min"); $(document).ready(function () { let language = $('html').attr('lang'); moment.locale(language); $('.moment').each(function() { date = $(this).text() $(this).text(moment(date).format('LL'))
147
315
13
GitHub: worknenjoy/gitpay
5 6 7 8 9 10 11 12 13 14
const i18n = require('i18n') const constants = require('./constants') const withTemplate = require('./template') const models = require('../../models') // moment.locale('pt-br', ptLocale) const setMomentLocale = (lang) => { if (lang === 'br') { moment.locale('pt-br', ptLocale)
145
153
14
+ 5 other calls in file
GitHub: ryanlelek/Raneto
47 48 49 50 51 52 53 54 55 56
// Set IP Address and Port app.set('host', process.env.HOST || '127.0.0.1'); app.set('port', process.env.PORT || 3000); // set locale as date and time format moment.locale(config.locale); // Setup Views if (!config.theme_dir) { config.theme_dir = path.join(__dirname, '..', 'themes'); } if (!config.theme_name) { config.theme_name = 'default'; }
450
0
95
+ 3 other calls in file
moment.utc is the most popular function in moment (43 examples)