PageRenderTime 40ms CodeModel.GetById 13ms app.highlight 20ms RepoModel.GetById 2ms app.codeStats 0ms

/node_modules/moment/src/locale/is.js

https://bitbucket.org/coleman333/smartsite
JavaScript | 124 lines | 117 code | 4 blank | 3 comment | 27 complexity | bea50a229c8d1fa68059d1406405898e MD5 | raw file
  1//! moment.js locale configuration
  2//! locale : Icelandic [is]
  3//! author : Hinrik Örn Sigurðsson : https://github.com/hinrik
  4
  5import moment from '../moment';
  6
  7function plural(n) {
  8    if (n % 100 === 11) {
  9        return true;
 10    } else if (n % 10 === 1) {
 11        return false;
 12    }
 13    return true;
 14}
 15function translate(number, withoutSuffix, key, isFuture) {
 16    var result = number + ' ';
 17    switch (key) {
 18        case 's':
 19            return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';
 20        case 'ss':
 21            if (plural(number)) {
 22                return result + (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum');
 23            }
 24            return result + 'sekúnda';
 25        case 'm':
 26            return withoutSuffix ? 'mínúta' : 'mínútu';
 27        case 'mm':
 28            if (plural(number)) {
 29                return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');
 30            } else if (withoutSuffix) {
 31                return result + 'mínúta';
 32            }
 33            return result + 'mínútu';
 34        case 'hh':
 35            if (plural(number)) {
 36                return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');
 37            }
 38            return result + 'klukkustund';
 39        case 'd':
 40            if (withoutSuffix) {
 41                return 'dagur';
 42            }
 43            return isFuture ? 'dag' : 'degi';
 44        case 'dd':
 45            if (plural(number)) {
 46                if (withoutSuffix) {
 47                    return result + 'dagar';
 48                }
 49                return result + (isFuture ? 'daga' : 'dögum');
 50            } else if (withoutSuffix) {
 51                return result + 'dagur';
 52            }
 53            return result + (isFuture ? 'dag' : 'degi');
 54        case 'M':
 55            if (withoutSuffix) {
 56                return 'mánuður';
 57            }
 58            return isFuture ? 'mánuð' : 'mánuði';
 59        case 'MM':
 60            if (plural(number)) {
 61                if (withoutSuffix) {
 62                    return result + 'mánuðir';
 63                }
 64                return result + (isFuture ? 'mánuði' : 'mánuðum');
 65            } else if (withoutSuffix) {
 66                return result + 'mánuður';
 67            }
 68            return result + (isFuture ? 'mánuð' : 'mánuði');
 69        case 'y':
 70            return withoutSuffix || isFuture ? 'ár' : 'ári';
 71        case 'yy':
 72            if (plural(number)) {
 73                return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
 74            }
 75            return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
 76    }
 77}
 78
 79export default moment.defineLocale('is', {
 80    months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),
 81    monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
 82    weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),
 83    weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
 84    weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
 85    longDateFormat : {
 86        LT : 'H:mm',
 87        LTS : 'H:mm:ss',
 88        L : 'DD.MM.YYYY',
 89        LL : 'D. MMMM YYYY',
 90        LLL : 'D. MMMM YYYY [kl.] H:mm',
 91        LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm'
 92    },
 93    calendar : {
 94        sameDay : '[í dag kl.] LT',
 95        nextDay : '[á morgun kl.] LT',
 96        nextWeek : 'dddd [kl.] LT',
 97        lastDay : '[í gær kl.] LT',
 98        lastWeek : '[síðasta] dddd [kl.] LT',
 99        sameElse : 'L'
100    },
101    relativeTime : {
102        future : 'eftir %s',
103        past : 'fyrir %s síðan',
104        s : translate,
105        ss : translate,
106        m : translate,
107        mm : translate,
108        h : 'klukkustund',
109        hh : translate,
110        d : translate,
111        dd : translate,
112        M : translate,
113        MM : translate,
114        y : translate,
115        yy : translate
116    },
117    dayOfMonthOrdinalParse: /\d{1,2}\./,
118    ordinal : '%d.',
119    week : {
120        dow : 1, // Monday is the first day of the week.
121        doy : 4  // The week that contains Jan 4th is the first week of the year.
122    }
123});
124