From: Tim Wood Date: Thu, 1 Dec 2011 18:55:19 +0000 (-0800) Subject: Building docs X-Git-Tag: 1.2.0~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5234ff14874e590f86afa999741805b0aa9072d2;p=thirdparty%2Fmoment.git Building docs --- diff --git a/site/docs/index.html b/site/docs/index.html index e97758dd8..37026364d 100644 --- a/site/docs/index.html +++ b/site/docs/index.html @@ -1,4 +1,4 @@ -Moment.js Documentation

Moment.js Documentation

A lightweight javascript date library for parsing, manipulating, and formatting dates.

Where to get it

Github

Production Version 1.1.22.8kb minified & gzippedDevelopment Version 1.1.220.1kb full source + comments

You can also clone the project with Git by running:

git clone git://github.com/timrwood/moment

npm

npm install moment

Where to use it

Moment was designed to work in both the browser and in NodeJS. All code will work in both environments. All unit tests are run in both environments.

In NodeJS

var moment = require('moment');
+Moment.js Documentation

Moment.js Documentation

A lightweight javascript date library for parsing, manipulating, and formatting dates.

Where to get it

Github

Production Version 1.1.22.8kb minified & gzippedDevelopment Version 1.1.220.1kb full source + comments

You can also clone the project with Git by running:

git clone git://github.com/timrwood/moment

npm

npm install moment

Where to use it

Moment was designed to work in both the browser and in NodeJS. All code will work in both environments. All unit tests are run in both environments.

In NodeJS

var moment = require('moment');
 moment().add('hours', 1).fromNow(); // "1 hour ago"
 

In the browser

<script src="moment.min.js"></script>
 moment().add('hours', 1).fromNow(); // "1 hour ago"
@@ -94,6 +94,9 @@ a.diff(b, 'years', true) // 1.5
 moment([2001]).isLeapYear() // false
 
 moment([2100]).isLeapYear() // false
+

Timezone Offset

moment().zone(); // get the timezone offset in minutes (60, 120, 240, etc.)

Daylight Savings Time

moment.fn.isLeapYear checks if the current moment is in daylight savings time or not. +

moment([2011, 2, 12]).isDST(); // false, March 12 2011 is not DST
+moment([2011, 2, 14]).isDST(); // true, March 14 2011 is DST
 

I18N

Moment.js has pretty robust support for internationalization. You can load multiple languages onto the same instance and easily switch between them.

Changing languages

By default, Moment.js comes with English language strings. If you need other languages, you can load them into Moment.js for later use.

To load a language, pass the key and the string values to moment.lang.

Note: More details on each of the parts of the language bundle can be found in the customization section.

moment.lang('fr', {
@@ -202,7 +205,7 @@ moment(1316116057189).fromNow(); // il y a une heure
         (b === 2) ? 'nd' : 
         (b === 3) ? 'rd' : 'th';
 };
-

For more information on ordinal numbers, see wikipedia