cscg24-guacamole

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

en.js (1013B)


      1import './prototype';
      2import { getSetGlobalLocale } from './locales';
      3import toInt from '../utils/to-int';
      4
      5getSetGlobalLocale('en', {
      6    eras: [
      7        {
      8            since: '0001-01-01',
      9            until: +Infinity,
     10            offset: 1,
     11            name: 'Anno Domini',
     12            narrow: 'AD',
     13            abbr: 'AD',
     14        },
     15        {
     16            since: '0000-12-31',
     17            until: -Infinity,
     18            offset: 1,
     19            name: 'Before Christ',
     20            narrow: 'BC',
     21            abbr: 'BC',
     22        },
     23    ],
     24    dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
     25    ordinal: function (number) {
     26        var b = number % 10,
     27            output =
     28                toInt((number % 100) / 10) === 1
     29                    ? 'th'
     30                    : b === 1
     31                      ? 'st'
     32                      : b === 2
     33                        ? 'nd'
     34                        : b === 3
     35                          ? 'rd'
     36                          : 'th';
     37        return number + output;
     38    },
     39});