Skip to content

Loading…

Removed formatting dots from Dutch month/weekday abbreviations. #325

Closed
wants to merge 1 commit into from

3 participants

@cgbeekman

This allows for custom formats such as 'D-MMM-YYYY'. Current code gives f.e. '23-jun.-2012' while '23-jun-2012' is expected/preferred.

@timrwood
Moment.js member

@jjupiter, you submitted the original language, what's your input?

@timrwood
Moment.js member

@jjupiter seems to be afk for the past couple months. According to http://cldr.unicode.org/, the dots seem to be preferred in formatting tokens.

<monthContext type="format">
    <monthWidth type="abbreviated">
        <month type="1">jan.</month>
        <month type="2">feb.</month>
        <month type="3">mrt.</month>
        ...
@cgbeekman

It's a bit tricky indeed. If used in a sentence, the abbreviations containing dots are perfectly fine. It is only when combined with a non-space separator (as in my example) that the dots should be left out (imho). The JVM also outputs '23-jun-2012'. I understand that this breaks existing code using 'MMM'. If you are unwilling to change this, could you suggest a workaround? The only thing I can think of is using a custom language file, but this seems a bit overkill.

@timrwood
Moment.js member

We are thinking of adding callbacks for month and weekday names in #313 so you could do something like this in the lang config perhaps:

monthsShort : function function (momentToFormat, format) {
    if (/-MMM-/.test(format)) {
        return withDots[momentToFormat.month()];
    } else {
        return withoutDots[momentToFormat.month()];
    }
}
@cgbeekman

That sounds like a plan, thanks. I'll open a pull request once available.

@timrwood
Moment.js member

Cool, you can check out the feature/add-month-name-callback and write code and tests against that.

@timrwood timrwood referenced this pull request
Closed

1.7.0 Changelog #288

@timrwood
Moment.js member

This has been merged into the develop branch, so you can write tests and code against that. Also, please change the pull request to be to the develop branch instead of the master branch. Thanks!

@rockymeza

@timrwood, this has been merged then? Can we close this pull request?

@timrwood
Moment.js member

This has been merged into the develop branch, so you can write tests and code against that.

Sorry, I was referring to #313 being merged into develop (adding the month name and weekday name callbacks).

@cgbeekman, I'm closing this out, but when you have the code and tests written based on the comment above please submit a new pull request to the develop branch.

@timrwood timrwood closed this
@cgbeekman

I'm working on this, but fixed another issue first: #346
Unfortunately, I did not create the changes in a separate branch so I'm unable to file a pull request for them until #346 has been pulled.

@timrwood
Moment.js member

You can just add them to #346 if you want. They are both on the same lang file, so I think it's related enough. I think you should be able to change the range of the pull request, but if not, let me know and I'll merge in #346 so you can submit the other request.

@cgbeekman

Added my commits to #346, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lang/nl.js
View
4 lang/nl.js
@@ -1,9 +1,9 @@
(function () {
var lang = {
months : "januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),
- monthsShort : "jan._feb._mar._apr._mei._jun._jul._aug._sep._okt._nov._dec.".split("_"),
+ monthsShort : "jan_feb_mar_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),
weekdays : "zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),
- weekdaysShort : "zo._ma._di._wo._do._vr._za.".split("_"),
+ weekdaysShort : "zo_ma_di_wo_do_vr_za".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "DD-MM-YYYY",
Something went wrong with that request. Please try again.