Skip to content

Commit

Permalink
Changing all "m/d/yyyy" formatted dates to default to the "yyyy-mm-dd…
Browse files Browse the repository at this point in the history
…" ISO 8601 date format. Closes gruntjs#78.
  • Loading branch information
cowboy committed Mar 27, 2012
1 parent 4a969a4 commit d0631e8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/api_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ grunt.template.date(date, format)
In this example, a specific date is formatted as month/day/year.

```javascript
grunt.template.date(847602000000, 'mm/dd/yyyy') // '11/10/1996'
grunt.template.date(847602000000, 'yyyy-mm-dd') // '1996-11-10'
```

### grunt.template.today
Expand Down
2 changes: 1 addition & 1 deletion docs/task_concat.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ grunt.initConfig({
pkg: '<json:package.json>',
meta: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("m/d/yyyy") %> */'
'<%= grunt.template.today("yyyy-mm-dd") %> */'
},
concat: {
dist: {
Expand Down
2 changes: 1 addition & 1 deletion docs/task_min.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ grunt.initConfig({
pkg: '<json:package.json>',
meta: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("m/d/yyyy") %> */'
'<%= grunt.template.today("yyyy-mm-dd") %> */'
},
min: {
dist: {
Expand Down
2 changes: 1 addition & 1 deletion tasks/init/commonjs/root/grunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = function(grunt) {
pkg: '<json:package.json>',
meta: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("m/d/yyyy") %>\n' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
Expand Down
4 changes: 2 additions & 2 deletions tasks/init/gruntfile/root/grunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ module.exports = function(grunt) {
pkg: '<json:package.json>',
meta: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("m/d/yyyy") %>\n' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
},{% } else { %}
meta: {
banner: '/*! PROJECT_NAME - v0.1.0 - {%= grunt.template.today("m/d/yyyy") %}\n' +
banner: '/*! PROJECT_NAME - v0.1.0 - {%= grunt.template.today("yyyy-mm-dd") %}\n' +
'* Copyright (c) {%= grunt.template.today("yyyy") %} YOUR_NAME; Licensed MIT %> */'
},{% } } %}
lint: {
Expand Down
2 changes: 1 addition & 1 deletion tasks/init/jquery/root/grunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = function(grunt) {
pkg: '<json:package.json>',
meta: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("m/d/yyyy") %>\n' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
Expand Down
4 changes: 2 additions & 2 deletions test/tasks/misc_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ exports['banner'] = function(test) {
config('test_config.banner', '<%= _.pluck(test_config.d, "a").join(", ") %>');
test.equal(grunt.helper('banner', 'test_config.banner'), utils.normalizelf('1, 2, 3\n'), 'It should join arrays.');

config('test_config.banner', '<%= grunt.template.today("m/d/yyyy") %>');
test.equal(grunt.helper('banner', 'test_config.banner'), utils.normalizelf(template.today('m/d/yyyy') + '\n'), 'It should parse the current date correctly.');
config('test_config.banner', '<%= grunt.template.today("yyyy-mm-dd") %>');
test.equal(grunt.helper('banner', 'test_config.banner'), utils.normalizelf(template.today('yyyy-mm-dd') + '\n'), 'It should parse the current date correctly.');

test.done();
};

0 comments on commit d0631e8

Please sign in to comment.