cscg24-guacamole

CSCG 2024 Challenge 'Guacamole Mashup'
git clone https://git.sinitax.com/sinitax/cscg24-guacamole
Log | Files | Refs | sfeed.txt

hr.js (4718B)


      1//! moment.js locale configuration
      2//! locale : Croatian [hr]
      3//! author : Bojan Marković : https://github.com/bmarkovic
      4
      5import moment from '../moment';
      6
      7function translate(number, withoutSuffix, key) {
      8    var result = number + ' ';
      9    switch (key) {
     10        case 'ss':
     11            if (number === 1) {
     12                result += 'sekunda';
     13            } else if (number === 2 || number === 3 || number === 4) {
     14                result += 'sekunde';
     15            } else {
     16                result += 'sekundi';
     17            }
     18            return result;
     19        case 'm':
     20            return withoutSuffix ? 'jedna minuta' : 'jedne minute';
     21        case 'mm':
     22            if (number === 1) {
     23                result += 'minuta';
     24            } else if (number === 2 || number === 3 || number === 4) {
     25                result += 'minute';
     26            } else {
     27                result += 'minuta';
     28            }
     29            return result;
     30        case 'h':
     31            return withoutSuffix ? 'jedan sat' : 'jednog sata';
     32        case 'hh':
     33            if (number === 1) {
     34                result += 'sat';
     35            } else if (number === 2 || number === 3 || number === 4) {
     36                result += 'sata';
     37            } else {
     38                result += 'sati';
     39            }
     40            return result;
     41        case 'dd':
     42            if (number === 1) {
     43                result += 'dan';
     44            } else {
     45                result += 'dana';
     46            }
     47            return result;
     48        case 'MM':
     49            if (number === 1) {
     50                result += 'mjesec';
     51            } else if (number === 2 || number === 3 || number === 4) {
     52                result += 'mjeseca';
     53            } else {
     54                result += 'mjeseci';
     55            }
     56            return result;
     57        case 'yy':
     58            if (number === 1) {
     59                result += 'godina';
     60            } else if (number === 2 || number === 3 || number === 4) {
     61                result += 'godine';
     62            } else {
     63                result += 'godina';
     64            }
     65            return result;
     66    }
     67}
     68
     69export default moment.defineLocale('hr', {
     70    months: {
     71        format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split(
     72            '_'
     73        ),
     74        standalone:
     75            'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split(
     76                '_'
     77            ),
     78    },
     79    monthsShort:
     80        'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split(
     81            '_'
     82        ),
     83    monthsParseExact: true,
     84    weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
     85        '_'
     86    ),
     87    weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
     88    weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
     89    weekdaysParseExact: true,
     90    longDateFormat: {
     91        LT: 'H:mm',
     92        LTS: 'H:mm:ss',
     93        L: 'DD.MM.YYYY',
     94        LL: 'Do MMMM YYYY',
     95        LLL: 'Do MMMM YYYY H:mm',
     96        LLLL: 'dddd, Do MMMM YYYY H:mm',
     97    },
     98    calendar: {
     99        sameDay: '[danas u] LT',
    100        nextDay: '[sutra u] LT',
    101        nextWeek: function () {
    102            switch (this.day()) {
    103                case 0:
    104                    return '[u] [nedjelju] [u] LT';
    105                case 3:
    106                    return '[u] [srijedu] [u] LT';
    107                case 6:
    108                    return '[u] [subotu] [u] LT';
    109                case 1:
    110                case 2:
    111                case 4:
    112                case 5:
    113                    return '[u] dddd [u] LT';
    114            }
    115        },
    116        lastDay: '[jučer u] LT',
    117        lastWeek: function () {
    118            switch (this.day()) {
    119                case 0:
    120                    return '[prošlu] [nedjelju] [u] LT';
    121                case 3:
    122                    return '[prošlu] [srijedu] [u] LT';
    123                case 6:
    124                    return '[prošle] [subote] [u] LT';
    125                case 1:
    126                case 2:
    127                case 4:
    128                case 5:
    129                    return '[prošli] dddd [u] LT';
    130            }
    131        },
    132        sameElse: 'L',
    133    },
    134    relativeTime: {
    135        future: 'za %s',
    136        past: 'prije %s',
    137        s: 'par sekundi',
    138        ss: translate,
    139        m: translate,
    140        mm: translate,
    141        h: translate,
    142        hh: translate,
    143        d: 'dan',
    144        dd: translate,
    145        M: 'mjesec',
    146        MM: translate,
    147        y: 'godinu',
    148        yy: translate,
    149    },
    150    dayOfMonthOrdinalParse: /\d{1,2}\./,
    151    ordinal: '%d.',
    152    week: {
    153        dow: 1, // Monday is the first day of the week.
    154        doy: 7, // The week that contains Jan 7th is the first week of the year.
    155    },
    156});