locale.meridian function does not exists if languages app is not installed

master
Ignas Bukys 2020-04-25 23:02:10 +03:00
parent 8527cac593
commit 152b0e617b
1 changed files with 6 additions and 1 deletions

View File

@ -12,7 +12,12 @@
date.setMonth(1, 3) // februari: months are zero-indexed
const localized = locale.date(date, true)
locale.dayFirst = /3.*2/.test(localized)
locale.hasMeridian = (locale.meridian(date) !== '')
locale.hasMeridian = false
if(typeof locale.meridian === 'function') { // function does not exists if languages app is not installed
locale.hasMeridian = (locale.meridian(date) !== '')
}
}
const screen = {
width: g.getWidth(),