Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 628 Bytes

07-browserify.md

File metadata and controls

35 lines (29 loc) · 628 Bytes
title
Browserify
npm install moment
var moment = require('moment');
moment().format();

Note: There is a bug that prevents moment.locale from being loaded.

var moment = require('moment');
moment.locale('cs');
console.log(moment.locale()); // en

Use the workaround below

var moment = require('moment');
require('moment/locale/cs');
console.log(moment.locale()); // cs

In order to include all the locales

var moment = require('moment');
require("moment/min/locales.min");
moment.locale('cs');
console.log(moment.locale()); // cs