Date.js

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.

Changelog

  • 2008-04-04 v0.1: Initial public release.

Documentation

The generated online documentation can be found here.

Download

License

Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0>

Author

Henrik Lindqvist <henrik.lindqvist@llamalab.com>