Adding localized format, parse, week numbering functionality
An extension for JavaScript’s build-in Date class,
that adds localized format, parse, week numbering functionality and more (see documentation). The parsing/formatting uses patterns compatible with
java.text.SimpleDateFormat. The main source file only includes localizations for
en-US
and iso
, but new localization can easily be added through external files, see below.
Contact me if you wan’t a particular localization made or you have made one you’ll like to share.
Simple and initiative usage:
var dateString = nowDate.format('yyyy-MM-dd HH:mm:ss', 'en'); var parsedDate = Date.parse(dateString, 'yyyy-MM-dd HH:mm:ss', 'en');
Test it out here.
The generated online documentation can be found here.
Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0>
Henrik Lindqvist <henrik.lindqvist@llamalab.com>