UNPKG

colloquial-time

Version:

A lightweight library to express time in colloquial, human-friendly phrases for various languages.

50 lines (49 loc) 971 B
module.exports = { numbers: [ '', 'hiji', 'dua', 'tilu', 'opat', 'lima', 'genep', 'tujuh', 'dalapan', 'salapan', 'sapuluh', 'sabelas', 'dua belas', ], minutePrepositions: { 5: 'lima', 10: 'sapuluh', 20: 'dua puluh', 25: 'dua puluh lima', }, halfHourPrepositions: { 15: 'saparapat', 30: 'satengah', }, timeOfDay: [ [0, 11, 'isuk'], [12, 15, 'beurang'], [16, 18, 'soré'], [19, 23, 'peuting'], ], words: { timePrefix: 'tabuh', hourPrefix: '', hourSuffix: '', less: 'kurang', more: 'leuwihan', minutePrefix: '', minuteSuffix: '', }, format: { exactHour: '{timePrefix} {hour} {timeOfDay}', pastMinutes: '{timePrefix} {hour} {more} {minutes} {minuteSuffix} {timeOfDay}', toMinutes: '{timePrefix} {hour} {less} {minutes} {minuteSuffix} {timeOfDay}', quarterPast: '{timePrefix} {hour} {quarterPreposition} {timeOfDay}', halfTo: '{timePrefix} {halfHourPrepositions} {nextHour} {timeOfDay}', }, };