Date.js

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 nowDate = new Date();
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.

Documentation

The generated online documentation can be found here.

Changelog

Download

License

GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl-3.0.txt>

Author

Henrik Lindqvist <henrik.lindqvist@llamalab.com>

Comment

Enter the code visible here into the Code field
> Delete | Edit