PHPackages                             gaomingcode/date.js - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. gaomingcode/date.js

ActiveLibrary

gaomingcode/date.js
===================

DateJS is the most full-featured, internationalized, open-source JavaScript Date Library.

1.0.0(4y ago)010MITJavaScript

Since Jun 5Pushed 4y agoCompare

[ Source](https://github.com/gaomingcode/date.js)[ Packagist](https://packagist.org/packages/gaomingcode/date.js)[ Docs](https://github.com/abritinthebay/datejs)[ RSS](/packages/gaomingcode-datejs/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

DateJS: Evolved
===============

[](#datejs-evolved)

[![GitHub Version](https://camo.githubusercontent.com/2914fec400cc5d922e7e015e821d35a5f965f39ef75ef43b22e7803cb7e238a1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f67616f6d696e67636f64652f646174652e6a732e737667)](https://github.com/gaomingcode/date.js)[![Packagist Downloads](https://camo.githubusercontent.com/f6656cafe8e3c26619a823eaf772e407c8e03fed433ad500372a42ebcd9e6557/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f67616f6d696e67636f64652f646174652e6a73)](https://github.com/gaomingcode/date.js)[![Github License](https://camo.githubusercontent.com/986cfffeff5cb9a7687e3f37f54e3ccac82f3f03477d0e64f6468578e8f6fe5d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f67616f6d696e67636f64652f646174652e6a73)](https://github.com/gaomingcode/date.js)

Installation
------------

[](#installation)

### Composer

[](#composer)

```
composer require gaomingcode/date.js

```

ReadMe from Origin
------------------

[](#readme-from-origin)

The JavaScript Date Library
[![Build Status](https://camo.githubusercontent.com/de851f6e72a4c7edd88792d49790590c51a8e6950bb899edb630195f409b34a9/68747470733a2f2f7472617669732d63692e6f72672f6162726974696e7468656261792f646174656a732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/abritinthebay/datejs)[![NPM version](https://camo.githubusercontent.com/3cfc87fc46040c5b6c08db7564f69f5387d7847195448ce22f5a7d25daba0f9e/68747470733a2f2f62616467652e667572792e696f2f6a732f646174656a732e737667)](http://badge.fury.io/js/datejs)[![Code Climate](https://camo.githubusercontent.com/0d80293ec0cd20061f7682c354d1fa79dda0905792f11c376848af85f2f13239/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6162726974696e7468656261792f646174656a732e737667)](https://codeclimate.com/github/abritinthebay/datejs)[![Test Coverage](https://camo.githubusercontent.com/91b99c4ada9dd948065f386f841836bccfbc2e600a9a3ede05f9719190c52a57/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6162726974696e7468656261792f646174656a732f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/abritinthebay/datejs)

What is it?
-----------

[](#what-is-it)

DateJS extends the built-in JavaScript Date object to add much better parsing, internationalization support, and all the functions and syntactic sugar you could wish for.

### Background

[](#background)

Date JS was started by Geoffrey McGill in 2007, he abandoned it on May 13th 2008; leaving the Google Code repository stagnant and with many bugs unresolved.

This fork was started improve and maintain DateJS. To keep what is still the most full featured JavaScript Date library alive, maintained, and improved. Currently we're on track towards a 1.0 release - having fixed almost all the existing bugs and added several new features, improved parsing, and many other changes.

### How to Install/Use

[](#how-to-installuse)

DateJS supports running either your regular web browser as a client library or Node.js.

#### In Node.js

[](#in-nodejs)

Installation is as easy as running:

```
npm install datejs

```

To run just `require('datejs')` and DateJS will extend the built in Date object like it does in the browser.

#### For a Browser

[](#for-a-browser)

If you use [Bower](http://bower.io/) to manage your frontend packages then it's also really simple:

```
bower install datejs

```

Otherwise...

- For production environments include [the production ready minified file from the Build directory](https://github.com/abritinthebay/datejs/blob/master/build/production/date.min.js) on your page.
- For debugging (eg, in development) include [the unminified and fully commented version](https://github.com/abritinthebay/datejs/blob/master/build/date.js)

#### International Language Versions

[](#international-language-versions)

DateJS supports 157 different languages and dialects and ships with US English as the default. It is however easily changed and you can support languages on the fly or just a specific subset.

##### In Node.js

[](#in-nodejs-1)

Just call the following: `Date.i18n.setLanguage([country code])`Where "country code" is the appropriate IETF code for the language (e.g. "de-DE", or "es-MX") and DateJS will import the correct strings for that language.

##### In a Browser

[](#in-a-browser)

For browsers DateJS has langauge support in one of two ways:

1. Set `Date.Config.i18n` to the location of [the internationalization files](https://github.com/abritinthebay/datejs/blob/master/build/i18n/) on your server and DateJS will dynamically load the files by dynamic script element insertion. You can support all languages this way.
2. Or download the appropriate file from [the Build directory of your choice](https://github.com/abritinthebay/datejs/blob/master/build/). Files are named after the IETF code the load (i.e. `date-es-MX.js` loads Mexican Spanish). This static method will *only* allow you support of the selected language &amp; US English.

DateJS +will always support loading US English\_ via `Date.i18n.setLanguage("en-US")` no matter what other language is specifically loaded. So you can always support both your localization and the English speaking world.

File Structure
--------------

[](#file-structure)

- `build/` Output from the Grunt powered build process
    - Non-minified files with full comments. Suitable for development environments.
    - `production/` Fully minified (by Google's Closure Compiler) files suitable for production.
- `src` All the source files used to build the final files.
    - `core/` The main DateJS source files.
    - `i18n/` Internationalization files. Language specifics (days of the week, regex formats,etc). Organized by IETF language tag (eg - en-US, etc).
- `specs/` Unit Tests written using [Jasmine](https://jasmine.github.io/). Code coverage is calculated by [BlanketJS](http://blanketjs.org/).
- `reports/` Code coverage reports in `lcov` and `html` that are generated by [Istanbul](http://gotwarlost.github.io/istanbul/)
- `tests/` Orginal unit tests for 2008 project. *Deprecated*

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1805d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b333bd44a2f7f526cc29a59b2945b27c7d2f31df68b92c2eb46efbddc032483?d=identicon)[gaomingcode](/maintainers/gaomingcode)

---

Top Contributors

[![atus](https://avatars.githubusercontent.com/u/1918329?v=4)](https://github.com/atus "atus (11 commits)")[![gaomingcode](https://avatars.githubusercontent.com/u/53959161?v=4)](https://github.com/gaomingcode "gaomingcode (5 commits)")[![keemy](https://avatars.githubusercontent.com/u/626229?v=4)](https://github.com/keemy "keemy (3 commits)")[![goetas](https://avatars.githubusercontent.com/u/776743?v=4)](https://github.com/goetas "goetas (1 commits)")[![keheliya](https://avatars.githubusercontent.com/u/181962?v=4)](https://github.com/keheliya "keheliya (1 commits)")[![mortonfox](https://avatars.githubusercontent.com/u/495892?v=4)](https://github.com/mortonfox "mortonfox (1 commits)")[![nathanpeck](https://avatars.githubusercontent.com/u/3495674?v=4)](https://github.com/nathanpeck "nathanpeck (1 commits)")[![PeterDaveHello](https://avatars.githubusercontent.com/u/3691490?v=4)](https://github.com/PeterDaveHello "PeterDaveHello (1 commits)")[![victordidenko](https://avatars.githubusercontent.com/u/15016227?v=4)](https://github.com/victordidenko "victordidenko (1 commits)")[![vitorhsb](https://avatars.githubusercontent.com/u/86801?v=4)](https://github.com/vitorhsb "vitorhsb (1 commits)")[![dzhus](https://avatars.githubusercontent.com/u/102053?v=4)](https://github.com/dzhus "dzhus (1 commits)")[![fleeting](https://avatars.githubusercontent.com/u/23062?v=4)](https://github.com/fleeting "fleeting (1 commits)")

---

Tags

javascriptJSdatemit

### Embed Badge

![Health badge](/badges/gaomingcode-datejs/health.svg)

```
[![Health](https://phpackages.com/badges/gaomingcode-datejs/health.svg)](https://phpackages.com/packages/gaomingcode-datejs)
```

###  Alternatives

[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k30.5M336](/packages/matthiasmullie-minify)[nostalgiaz/bootstrap-switch

Turn checkboxes and radio buttons into toggle switches.

5.0k362.3k4](/packages/nostalgiaz-bootstrap-switch)[mariuzzo/laravel-js-localization

Laravel Localization in JavaScript

6073.9M3](/packages/mariuzzo-laravel-js-localization)[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[nelmio/js-logger-bundle

Adds logging of JS errors in your Symfony application

1761.2M](/packages/nelmio-js-logger-bundle)[tholu/php-packer

A PHP version of Packer, JavaScript obfuscation library originally created by Dean Edwards

137441.2k5](/packages/tholu-php-packer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
