Skip to content

Commit

Permalink
Exclude dot from Dutch month abbreviations when surrounded by dashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgbeekman committed Jun 20, 2012
1 parent fc5be4f commit 698f38f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lang/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
// language : dutch (nl)
// author : Joris Röling : https://github.com/jjupiter
(function () {
var monthsShortWithDots = "jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_");
var monthsShortWithoutDots = "jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_");
var lang = {
months : "januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),
monthsShort : "jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),
monthsShort : function (m, format) {
if (/-MMM-/.test(format)) {
return monthsShortWithoutDots[m.month()];
} else {
return monthsShortWithDots[m.month()];
}
},
weekdays : "zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),
weekdaysShort : "zo._ma._di._wo._do._vr._za.".split("_"),
weekdaysMin : "Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),
Expand Down
10 changes: 10 additions & 0 deletions test/lang/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,5 +244,15 @@ exports["lang:nl"] = {
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
},

"month abbreviation" : function(test) {
test.expect(2);
moment.lang('nl');

test.equal(moment([2012, 5, 23]).format('D-MMM-YYYY'), '23-jun-2012', 'format month abbreviation surrounded by dashes should not include a dot');
test.equal(moment([2012, 5, 23]).format('D MMM YYYY'), '23 jun. 2012', 'format month abbreviation not surrounded by dashes should include a dot');

test.done();
}
};

0 comments on commit 698f38f

Please sign in to comment.