From: Tim Wood Date: Wed, 21 Dec 2011 01:26:29 +0000 (-0800) Subject: Only add cachebusting if the '-r' flag exists X-Git-Tag: 1.3.0~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e127aa179e3d2663c8820bf714fb3df4a2f37488;p=thirdparty%2Fmoment.git Only add cachebusting if the '-r' flag exists --- diff --git a/build.js b/build.js index 14792c512..a6252b681 100755 --- a/build.js +++ b/build.js @@ -49,6 +49,18 @@ var MINSIZE = 0; var SRCSIZE = 0; var BUILD_DATE = moment().format('YYMMDD_HHmmss'); +var cacheBusting = false; + + +process.argv.forEach(function(val, index, array) { + switch (val) { + case 'r': + cacheBusting = true; + break; + default : + break; + } +}); /********************************************* Helpers @@ -234,7 +246,7 @@ function jadeToHtml(jadePath, htmlPath) { version : VERSION, minsize : toKb(MINSIZE), srcsize : toKb(SRCSIZE), - builddate : BUILD_DATE + builddate : cacheBusting ? BUILD_DATE : 'nocachebuster' }; var snippet = fs.readFile(jadePath, 'utf8', function(err, data){ var compile = jade.compile(data, { diff --git a/site/docs/index.html b/site/docs/index.html index c4d92ea26..d5a83d2d6 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.2.03.1kb minified & gzippedDevelopment Version 1.2.021.2kb 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.2.03.1kb minified & gzippedDevelopment Version 1.2.021.2kb 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"
@@ -220,7 +220,7 @@ moment(1316116057189).fromNow(); // il y a une heure
         (b === 2) ? 'nd' : 
         (b === 3) ? 'rd' : 'th';
 };
-

For more information on ordinal numbers, see wikipedia