2022-10-06 20:20:42 +00:00
|
|
|
const DateFormatter = require("slidingtext.dtfmt.js");
|
2021-04-11 14:18:30 +00:00
|
|
|
const hoursToText = require("slidingtext.utils.en.js").hoursToText;
|
|
|
|
const numberToText = require("slidingtext.utils.en.js").numberToText;
|
2022-10-05 15:28:33 +00:00
|
|
|
const dayOfWeek = require("slidingtext.utils.en.js").dayOfWeek;
|
|
|
|
const numberToDayNumberText = require("slidingtext.utils.en.js").numberToDayNumberText;
|
|
|
|
const monthToText = require("slidingtext.utils.en.js").monthToText;
|
2021-04-11 14:18:30 +00:00
|
|
|
|
|
|
|
class EnglishDateFormatter extends DateFormatter {
|
2022-08-06 01:18:25 +00:00
|
|
|
constructor() {
|
|
|
|
super();
|
2022-10-08 18:57:32 +00:00
|
|
|
}
|
|
|
|
formatDate(date){
|
|
|
|
const hours_txt = hoursToText(date.getHours());
|
|
|
|
const mins_txt = numberToText(date.getMinutes());
|
|
|
|
const day_of_week = dayOfWeek(date);
|
|
|
|
const date_txt = numberToDayNumberText(date.getDate()).join(' ');
|
|
|
|
const month = monthToText(date);
|
|
|
|
return [hours_txt,mins_txt[0],mins_txt[1],day_of_week,date_txt,month];
|
|
|
|
}
|
2022-10-08 19:21:35 +00:00
|
|
|
defaultRowTypes() {
|
|
|
|
return {
|
|
|
|
small: {size: 'ssmall'}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultRowDefs(){
|
2022-10-08 18:57:32 +00:00
|
|
|
return [
|
2022-09-29 18:05:44 +00:00
|
|
|
{
|
|
|
|
type: 'large',
|
2022-10-05 15:28:33 +00:00
|
|
|
init_coords: [0.05,0.07],
|
2022-09-29 18:05:44 +00:00
|
|
|
row_direction: [0.0,1.0],
|
|
|
|
rows: 1
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'medium',
|
2022-10-05 15:28:33 +00:00
|
|
|
init_coords: [0.05,0.31],
|
2022-09-29 18:05:44 +00:00
|
|
|
row_direction: [0.0,1.0],
|
|
|
|
rows: 2
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'small',
|
2022-10-08 09:03:31 +00:00
|
|
|
init_coords: [0.05,0.75],
|
2022-09-29 18:05:44 +00:00
|
|
|
row_direction: [0.0,1.0],
|
2022-10-05 15:28:33 +00:00
|
|
|
rows: 2
|
2022-08-06 01:18:25 +00:00
|
|
|
}
|
2022-09-29 18:05:44 +00:00
|
|
|
];
|
2022-08-06 01:18:25 +00:00
|
|
|
}
|
2021-04-11 14:18:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = EnglishDateFormatter;
|