Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Changing all "m/d/yyyy" formatted dates to default to the "yyyy-mm-dd…

…" ISO 8601 date format. Closes #78.
  • Loading branch information...
commit d0631e80071489dafdd0741f97594f63dc1eba22 1 parent 4a969a4
Ben Alman authored
2  docs/api_template.md
Source Rendered
@@ -53,7 +53,7 @@ grunt.template.date(date, format)
53 53 In this example, a specific date is formatted as month/day/year.
54 54
55 55 ```javascript
56   -grunt.template.date(847602000000, 'mm/dd/yyyy') // '11/10/1996'
  56 +grunt.template.date(847602000000, 'yyyy-mm-dd') // '1996-11-10'
57 57 ```
58 58
59 59 ### grunt.template.today
2  docs/task_concat.md
Source Rendered
@@ -79,7 +79,7 @@ grunt.initConfig({
79 79 pkg: '<json:package.json>',
80 80 meta: {
81 81 banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
82   - '<%= grunt.template.today("m/d/yyyy") %> */'
  82 + '<%= grunt.template.today("yyyy-mm-dd") %> */'
83 83 },
84 84 concat: {
85 85 dist: {
2  docs/task_min.md
Source Rendered
@@ -127,7 +127,7 @@ grunt.initConfig({
127 127 pkg: '<json:package.json>',
128 128 meta: {
129 129 banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
130   - '<%= grunt.template.today("m/d/yyyy") %> */'
  130 + '<%= grunt.template.today("yyyy-mm-dd") %> */'
131 131 },
132 132 min: {
133 133 dist: {
2  tasks/init/commonjs/root/grunt.js
@@ -5,7 +5,7 @@ module.exports = function(grunt) {
5 5 pkg: '<json:package.json>',
6 6 meta: {
7 7 banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
8   - '<%= grunt.template.today("m/d/yyyy") %>\n' +
  8 + '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
9 9 '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
10 10 '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
11 11 ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
4 tasks/init/gruntfile/root/grunt.js
@@ -6,13 +6,13 @@ module.exports = function(grunt) {
6 6 pkg: '<json:package.json>',
7 7 meta: {
8 8 banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
9   - '<%= grunt.template.today("m/d/yyyy") %>\n' +
  9 + '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
10 10 '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
11 11 '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
12 12 ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
13 13 },{% } else { %}
14 14 meta: {
15   - banner: '/*! PROJECT_NAME - v0.1.0 - {%= grunt.template.today("m/d/yyyy") %}\n' +
  15 + banner: '/*! PROJECT_NAME - v0.1.0 - {%= grunt.template.today("yyyy-mm-dd") %}\n' +
16 16 '* Copyright (c) {%= grunt.template.today("yyyy") %} YOUR_NAME; Licensed MIT %> */'
17 17 },{% } } %}
18 18 lint: {
2  tasks/init/jquery/root/grunt.js
@@ -6,7 +6,7 @@ module.exports = function(grunt) {
6 6 pkg: '<json:package.json>',
7 7 meta: {
8 8 banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
9   - '<%= grunt.template.today("m/d/yyyy") %>\n' +
  9 + '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
10 10 '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
11 11 '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
12 12 ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
4 test/tasks/misc_test.js
@@ -74,8 +74,8 @@ exports['banner'] = function(test) {
74 74 config('test_config.banner', '<%= _.pluck(test_config.d, "a").join(", ") %>');
75 75 test.equal(grunt.helper('banner', 'test_config.banner'), utils.normalizelf('1, 2, 3\n'), 'It should join arrays.');
76 76
77   - config('test_config.banner', '<%= grunt.template.today("m/d/yyyy") %>');
78   - test.equal(grunt.helper('banner', 'test_config.banner'), utils.normalizelf(template.today('m/d/yyyy') + '\n'), 'It should parse the current date correctly.');
  77 + config('test_config.banner', '<%= grunt.template.today("yyyy-mm-dd") %>');
  78 + test.equal(grunt.helper('banner', 'test_config.banner'), utils.normalizelf(template.today('yyyy-mm-dd') + '\n'), 'It should parse the current date correctly.');
79 79
80 80 test.done();
81 81 };

0 comments on commit d0631e8

Please sign in to comment.
Something went wrong with that request. Please try again.