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
- 2008-04-04 v0.1: Initial public release.
Download
Minfied:Date.js (6 K)- Date_en-GB.js (0.1 K)
- Date_sv-SE.js (0.5 K)
Source:Date.js (15 K)- Date_en-GB.js (0.1 K)
- Date_sv-SE.js (0.6 K)
License
GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl-3.0.txt>
Author
Henrik Lindqvist <henrik.lindqvist@llamalab.com>