forked from hogart/datef
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
121 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "datef", | ||
"version": "0.2.0", | ||
"description": "Simple date formatting library, both for browser and node.js", | ||
"main": "datef.js", | ||
"homepage": "https://github.com/hogart/datef", | ||
"license": "MIT", | ||
|
||
"keywords": [ | ||
"moment", | ||
"date", | ||
"time", | ||
"format", | ||
"l10n" | ||
], | ||
|
||
"authors": [ | ||
"Konstantin Kitmanov <[email protected]>", | ||
"Maxim Ponomarev <[email protected]>" | ||
], | ||
|
||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/hogart/datef.git" | ||
}, | ||
|
||
"moduleType": [ | ||
"amd", | ||
"globals", | ||
"node" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
(function (factory) { | ||
if (typeof define === 'function' && define.amd) { | ||
define(['datef'], factory); | ||
} else if (typeof exports === 'object') { | ||
module.exports = factory(require('../datef')); | ||
} else { | ||
factory(window.datef); | ||
} | ||
}(function (datef) { | ||
datef.lang('pl', { | ||
_months: { | ||
nominative: 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpeń_wrzesień_październik_listopad_grudzień'.split('_'), | ||
accusative: 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_październik_listopada_grudnia'.split('_') | ||
}, | ||
months: function (date, format) { | ||
var nounCase = /dd?\s*MMMM?/.test(format) ? 'accusative' : 'nominative'; | ||
return this._months[nounCase][date.getMonth()]; | ||
}, | ||
_monthsShort: { | ||
nominative: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), | ||
accusative: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_') | ||
}, | ||
monthsShort: function (date, format) { | ||
var nounCase = /dd?\s*MMMM?/.test(format) ? 'accusative' : 'nominative'; | ||
return this._monthsShort[nounCase][date.getMonth()]; | ||
}, | ||
weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'), | ||
weekdaysShort: 'nie_pon_wt_śr_czw_pt_sb'.split('_'), | ||
weekdaysMin: 'N_Pn_Wt_Śr_Cz_Pt_So'.split('_'), | ||
meridiem : function (hour) { | ||
if (hour < 12) { | ||
return 'rano'; | ||
} else { | ||
return ''; | ||
} | ||
} | ||
}); | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var datef = require('../../datef'); | ||
require('chai').should(); | ||
|
||
describe('Polish language (pl)', function() { | ||
beforeEach(function() { | ||
datef.lang('pl'); | ||
}); | ||
it('should correct format the date', function() { | ||
'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpeń_wrzesień_październik_listopad_grudzień'.split('_').forEach(function(month, index) { | ||
datef('MMMM', '2008-' + (index + 1) + '-05').should.be.equal(month); | ||
}); | ||
'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_').forEach(function(month, index) { | ||
datef('MMM', '2008-' + (index + 1) + '-05').should.be.equal(month); | ||
}); | ||
'poniedziałek_wtorek_środa_czwartek_piątek_sobota_niedziela'.split('_').forEach(function(day, index) { | ||
datef('DDD', '2014-09-' + (index + 1)).should.be.equal(day); | ||
}); | ||
'pon_wt_śr_czw_pt_sb_nie'.split('_').forEach(function(day, index) { | ||
datef('DD', '2014-09-' + (index + 1)).should.be.equal(day); | ||
}); | ||
'Pn_Wt_Śr_Cz_Pt_So_N'.split('_').forEach(function(day, index) { | ||
datef('D', '2014-09-' + (index + 1)).should.be.equal(day); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters