mirror of
https://github.com/samsonjs/strftime.git
synced 2026-03-25 09:05:48 +00:00
Export strftime directly in Node, as module.exports, closes #10
This commit is contained in:
parent
b51b106177
commit
c93f523951
2 changed files with 5 additions and 5 deletions
|
|
@ -13,12 +13,12 @@ npm install strftime
|
|||
Usage
|
||||
=====
|
||||
|
||||
var strftime = require('strftime').strftime
|
||||
var strftime = require('strftime')
|
||||
console.log(strftime('%B %d, %y %H:%M:%S')) // => April 28, 2011 18:21:08
|
||||
|
||||
If you want to localize it:
|
||||
|
||||
var strftime = require('strftime').strftime
|
||||
var strftime = require('strftime')
|
||||
var it_IT = {
|
||||
days: [ 'domenica', 'lunedi', 'martedi', 'mercoledi', 'giovedi', 'venerdi', 'sabato' ],
|
||||
shortDays: [ 'dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab' ],
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
var namespace;
|
||||
|
||||
// CommonJS / Node module
|
||||
if (typeof exports !== 'undefined') {
|
||||
namespace = exports;
|
||||
if (typeof module !== 'undefined') {
|
||||
namespace = module.exports = strftime;
|
||||
}
|
||||
|
||||
// Browsers and other environments
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
, PM: 'PM'
|
||||
, am: 'am'
|
||||
, pm: 'pm'
|
||||
}
|
||||
};
|
||||
|
||||
function strftime(fmt, d, locale) {
|
||||
return _strftime(fmt, d, locale, false);
|
||||
|
|
|
|||
Loading…
Reference in a new issue