Format @DATE to ISO 8601 format. Fixes #12725, Closes gh-957

This commit is contained in:
Ben Truyman 2012-10-15 11:45:00 -04:00 committed by Rick Waldron
parent d01253e201
commit 96492b1d44

View File

@ -365,10 +365,19 @@ module.exports = function( grunt ) {
} }
}); });
// Embed Date
// Embed Version // Embed Version
compiled = compiled.replace( "@DATE", new Date() ) // Embed Date
.replace( /@VERSION/g, version ); compiled = compiled.replace( /@VERSION/g, version )
.replace( "@DATE", function () {
var date = new Date();
// YYYY-MM-DD
return [
date.getFullYear(),
date.getMonth() + 1,
date.getDate()
].join( "-" );
});
// Write concatenated source to file // Write concatenated source to file
file.write( name, compiled ); file.write( name, compiled );