]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Merge branch 'develop' of github.com:moment/moment into develop
authorIskren Chernev <iskren.chernev@gmail.com>
Sun, 8 Sep 2013 23:02:19 +0000 (16:02 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Sun, 8 Sep 2013 23:02:19 +0000 (16:02 -0700)
Conflicts:
lang/da.js
lang/ru.js

1  2 
lang/da.js
lang/ru.js
moment.js

diff --cc lang/da.js
index bed68f1c11620ed878f76e7f168ff43a00d5f3ac,fdf75636dcf3caf93f7a17688939d9c8836a5616..3a7c84ec25c0d999946d5d3792a4ab5ec4d1f847
@@@ -2,55 -2,45 +2,55 @@@
  // language : danish (da)
  // author : Ulrik Nielsen : https://github.com/mrbase
  
 -require('../moment').lang('da', {
 -    months : "januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),
 -    monthsShort : "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),
 -    weekdays : "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),
 -    weekdaysShort : "søn_man_tir_ons_tor_fre_lør".split("_"),
 -    weekdaysMin : "sø_ma_ti_on_to_fr_lø".split("_"),
 -    longDateFormat : {
 -        LT : "HH:mm",
 -        L : "DD/MM/YYYY",
 -        LL : "D MMMM YYYY",
 -        LLL : "D MMMM YYYY LT",
 -        LLLL : "dddd D. MMMM, YYYY LT"
 -    },
 -    calendar : {
 -        sameDay : '[I dag kl.] LT',
 -        nextDay : '[I morgen kl.] LT',
 -        nextWeek : 'dddd [kl.] LT',
 -        lastDay : '[I går kl.] LT',
 -        lastWeek : '[sidste] dddd [kl] LT',
 -        sameElse : 'L'
 -    },
 -    relativeTime : {
 -        future : "om %s",
 -        past : "%s siden",
 -        s : "få sekunder",
 -        m : "et minut",
 -        mm : "%d minutter",
 -        h : "en time",
 -        hh : "%d timer",
 -        d : "en dag",
 -        dd : "%d dage",
 -        M : "en måned",
 -        MM : "%d måneder",
 -        y : "et år",
 -        yy : "%d år"
 -    },
 -    ordinal : '%d.',
 -    week : {
 -        dow : 1, // Monday is the first day of the week.
 -        doy : 4  // The week that contains Jan 4th is the first week of the year.
 +(function (factory) {
 +    if (typeof define === 'function' && define.amd) {
 +        define(['moment'], factory); // AMD
 +    } else if (typeof exports === 'object') {
 +        factory(require('../moment')); // Node
 +    } else {
 +        factory(window.moment); // Browser global
      }
- }(function (moment) {
 -});
++}(function(moment) {
 +    moment.lang('da', {
-         months : "Januar_Februar_Marts_April_Maj_Juni_Juli_August_September_Oktober_November_December".split("_"),
-         monthsShort : "Jan_Feb_Mar_Apr_Maj_Jun_Jul_Aug_Sep_Okt_Nov_Dec".split("_"),
-         weekdays : "Søndag_Mandag_Tirsdag_Onsdag_Torsdag_Fredag_Lørdag".split("_"),
-         weekdaysShort : "Søn_Man_Tir_Ons_Tor_Fre_Lør".split("_"),
-         weekdaysMin : "Sø_Ma_Ti_On_To_Fr_Lø".split("_"),
++        months : "januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),
++        monthsShort : "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),
++        weekdays : "søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),
++        weekdaysShort : "søn_man_tir_ons_tor_fre_lør".split("_"),
++        weekdaysMin : "sø_ma_ti_on_to_fr_lø".split("_"),
 +        longDateFormat : {
 +            LT : "HH:mm",
 +            L : "DD/MM/YYYY",
 +            LL : "D MMMM YYYY",
 +            LLL : "D MMMM YYYY LT",
 +            LLLL : "dddd D. MMMM, YYYY LT"
 +        },
 +        calendar : {
 +            sameDay : '[I dag kl.] LT',
 +            nextDay : '[I morgen kl.] LT',
 +            nextWeek : 'dddd [kl.] LT',
 +            lastDay : '[I går kl.] LT',
 +            lastWeek : '[sidste] dddd [kl] LT',
 +            sameElse : 'L'
 +        },
 +        relativeTime : {
 +            future : "om %s",
 +            past : "%s siden",
 +            s : "få sekunder",
 +            m : "et minut",
 +            mm : "%d minutter",
 +            h : "en time",
 +            hh : "%d timer",
 +            d : "en dag",
 +            dd : "%d dage",
 +            M : "en måned",
 +            MM : "%d måneder",
 +            y : "et år",
 +            yy : "%d år"
 +        },
 +        ordinal : '%d.',
 +        week : {
 +            dow : 1, // Monday is the first day of the week.
 +            doy : 4  // The week that contains Jan 4th is the first week of the year.
 +        }
 +    });
 +}));
diff --cc lang/ru.js
index b3de77110d2181d8d238c946b6e9dff5759eb3cf,46e4f03089efe86b86ff95f64cf4578ce186bf09..a896eaa4bea0d57f08642cd3c59c71c2c6253d04
  // author : Viktorminator : https://github.com/Viktorminator
  // Author : Menelion Elensúle : https://github.com/Oire
  
 -function plural(word, num) {
 -    var forms = word.split('_');
 -    return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
 -}
 -
 -function relativeTimeWithPlural(number, withoutSuffix, key) {
 -    var format = {
 -        'mm': 'минута_минуты_минут',
 -        'hh': 'час_часа_часов',
 -        'dd': 'день_дня_дней',
 -        'MM': 'месяц_месяца_месяцев',
 -        'yy': 'год_года_лет'
 -    };
 -    if (key === 'm') {
 -        return withoutSuffix ? 'минута' : 'минуту';
 +(function (factory) {
 +    if (typeof define === 'function' && define.amd) {
 +        define(['moment'], factory); // AMD
 +    } else if (typeof exports === 'object') {
 +        factory(require('../moment')); // Node
 +    } else {
 +        factory(window.moment); // Browser global
 +    }
 +}(function (moment) {
 +    function plural(word, num) {
 +        var forms = word.split('_');
 +        return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
      }
 -    else {
 -        return number + ' ' + plural(format[key], +number);
 +
 +    function relativeTimeWithPlural(number, withoutSuffix, key) {
 +        var format = {
 +            'mm': 'минута_минуты_минут',
 +            'hh': 'час_часа_часов',
 +            'dd': 'день_дня_дней',
 +            'MM': 'месяц_месяца_месяцев',
 +            'yy': 'год_года_лет'
 +        };
 +        if (key === 'm') {
 +            return withoutSuffix ? 'минута' : 'минуту';
 +        }
 +        else {
 +            return number + ' ' + plural(format[key], +number);
 +        }
      }
 -}
  
 -function monthsCaseReplace(m, format) {
 -    var months = {
 -        'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
 -        'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')
 -    },
 +    function monthsCaseReplace(m, format) {
 +        var months = {
 +            'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
 +            'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')
 +        },
  
 -    nounCase = (/D[oD]? *MMMM?/).test(format) ?
 -        'accusative' :
 -        'nominative';
 +        nounCase = (/D[oD]? *MMMM?/).test(format) ?
 +            'accusative' :
 +            'nominative';
  
 -    return months[nounCase][m.month()];
 -}
 +        return months[nounCase][m.month()];
 +    }
  
 -function monthsShortCaseReplace(m, format) {
 -    var monthsShort = {
 -        'nominative': 'янв_фев_мар_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),
 -        'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_')
 -    },
++    function monthsShortCaseReplace(m, format) {
++        var monthsShort = {
++            'nominative': 'янв_фев_мар_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),
++            'accusative': 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_')
++        },
 -    nounCase = (/D[oD]? *MMMM?/).test(format) ?
 -        'accusative' :
 -        'nominative';
++        nounCase = (/D[oD]? *MMMM?/).test(format) ?
++            'accusative' :
++            'nominative';
 -    return monthsShort[nounCase][m.month()];
 -}
++        return monthsShort[nounCase][m.month()];
++    }
 -function weekdaysCaseReplace(m, format) {
 -    var weekdays = {
 -        'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
 -        'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_')
 -    },
 +    function weekdaysCaseReplace(m, format) {
 +        var weekdays = {
 +            'nominative': 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
 +            'accusative': 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_')
 +        },
  
 -    nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/).test(format) ?
 -        'accusative' :
 -        'nominative';
 +        nounCase = (/\[ ?[Вв] ?(?:прошлую|следующую)? ?\] ?dddd/).test(format) ?
 +            'accusative' :
 +            'nominative';
  
 -    return weekdays[nounCase][m.day()];
 -}
 +        return weekdays[nounCase][m.day()];
 +    }
  
 -require('../moment').lang('ru', {
 -    months : monthsCaseReplace,
 -    monthsShort : monthsShortCaseReplace,
 -    weekdays : weekdaysCaseReplace,
 -    weekdaysShort : "вск_пнд_втр_срд_чтв_птн_сбт".split("_"),
 -    weekdaysMin : "вс_пн_вт_ср_чт_пт_сб".split("_"),
 -    longDateFormat : {
 -        LT : "HH:mm",
 -        L : "DD.MM.YYYY",
 -        LL : "D MMMM YYYY г.",
 -        LLL : "D MMMM YYYY г., LT",
 -        LLLL : "dddd, D MMMM YYYY г., LT"
 -    },
 -    calendar : {
 -        sameDay: '[Сегодня в] LT',
 -        nextDay: '[Завтра в] LT',
 -        lastDay: '[Вчера в] LT',
 -        nextWeek: function () {
 -            return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';
 +    moment.lang('ru', {
 +        months : monthsCaseReplace,
-         monthsShort : "янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),
++        monthsShort : monthsShortCaseReplace,
 +        weekdays : weekdaysCaseReplace,
 +        weekdaysShort : "вск_пнд_втр_срд_чтв_птн_сбт".split("_"),
 +        weekdaysMin : "вс_пн_вт_ср_чт_пт_сб".split("_"),
 +        longDateFormat : {
 +            LT : "HH:mm",
 +            L : "DD.MM.YYYY",
 +            LL : "D MMMM YYYY г.",
 +            LLL : "D MMMM YYYY г., LT",
 +            LLLL : "dddd, D MMMM YYYY г., LT"
 +        },
 +        calendar : {
 +            sameDay: '[Сегодня в] LT',
 +            nextDay: '[Завтра в] LT',
 +            lastDay: '[Вчера в] LT',
 +            nextWeek: function () {
 +                return this.day() === 2 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';
 +            },
 +            lastWeek: function () {
 +                switch (this.day()) {
 +                case 0:
 +                    return '[В прошлое] dddd [в] LT';
 +                case 1:
 +                case 2:
 +                case 4:
 +                    return '[В прошлый] dddd [в] LT';
 +                case 3:
 +                case 5:
 +                case 6:
 +                    return '[В прошлую] dddd [в] LT';
 +                }
 +            },
 +            sameElse: 'L'
          },
 -        lastWeek: function () {
 -            switch (this.day()) {
 -            case 0:
 -                return '[В прошлое] dddd [в] LT';
 -            case 1:
 -            case 2:
 -            case 4:
 -                return '[В прошлый] dddd [в] LT';
 -            case 3:
 -            case 5:
 -            case 6:
 -                return '[В прошлую] dddd [в] LT';
 +        relativeTime : {
 +            future : "через %s",
 +            past : "%s назад",
 +            s : "несколько секунд",
 +            m : relativeTimeWithPlural,
 +            mm : relativeTimeWithPlural,
 +            h : "час",
 +            hh : relativeTimeWithPlural,
 +            d : "день",
 +            dd : relativeTimeWithPlural,
 +            M : "месяц",
 +            MM : relativeTimeWithPlural,
 +            y : "год",
 +            yy : relativeTimeWithPlural
 +        },
 +
 +        ordinal: function (number, period) {
 +            switch (period) {
 +            case 'M':
 +            case 'd':
 +            case 'DDD':
 +                return number + '-й';
 +            case 'D':
 +                return number + '-го';
 +            case 'w':
 +            case 'W':
 +                return number + '-я';
 +            default:
 +                return number;
              }
          },
 -        sameElse: 'L'
 -    },
 -    relativeTime : {
 -        future : "через %s",
 -        past : "%s назад",
 -        s : "несколько секунд",
 -        m : relativeTimeWithPlural,
 -        mm : relativeTimeWithPlural,
 -        h : "час",
 -        hh : relativeTimeWithPlural,
 -        d : "день",
 -        dd : relativeTimeWithPlural,
 -        M : "месяц",
 -        MM : relativeTimeWithPlural,
 -        y : "год",
 -        yy : relativeTimeWithPlural
 -    },
  
 -    ordinal: function (number, period) {
 -        switch (period) {
 -        case 'M':
 -        case 'd':
 -        case 'DDD':
 -            return number + '-й';
 -        case 'D':
 -            return number + '-го';
 -        case 'w':
 -        case 'W':
 -            return number + '-я';
 -        default:
 -            return number;
 +        week : {
 +            dow : 1, // Monday is the first day of the week.
 +            doy : 7  // The week that contains Jan 1st is the first week of the year.
          }
 -    },
 -
 -    week : {
 -        dow : 1, // Monday is the first day of the week.
 -        doy : 7  // The week that contains Jan 1st is the first week of the year.
 -    }
 -});
 +    });
 +}));
diff --cc moment.js
Simple merge