MCPcopy
hub / github.com/hugeinc/styleguide / formatDate

Function formatDate

styleguide/structure/_node-files/modules/write-date.js:11–27  ·  view source on GitHub ↗
(language)

Source from the content-addressed store, hash-verified

9 basePath = require('./utils').basePath;
10
11function formatDate(language) {
12 var finalDate,
13 date = new Date();
14
15 switch (language) {
16 case 'en_US' :
17 finalDate = date.getFullYear() + '/' + (parseInt(date.getMonth(), 10) + 1) + '/' + date.getDate();
18 break;
19 case 'pt_BR' :
20 finalDate = date.getDate() + '/' + (parseInt(date.getMonth(), 10) + 1) + '/' + date.getFullYear();
21 break;
22 default :
23 finalDate = date.getFullYear() + '/' + (parseInt(date.getMonth(), 10) + 1) + '/' + date.getDate();
24 }
25
26 return finalDate;
27}
28
29module.exports = function() {
30 var data = JSON.parse(fs.readFileSync(basePath + '/styleguide/_data.json'));

Callers 1

write-date.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…