2021-04-11 14:18:30 +00:00
|
|
|
var DateFormatter = require("slidingtext.dtfmt.js");
|
|
|
|
const hoursToText = require("slidingtext.utils.en.js").hoursToText;
|
|
|
|
const numberToText = require("slidingtext.utils.en.js").numberToText;
|
|
|
|
|
|
|
|
class EnglishDateFormatter extends DateFormatter {
|
2022-08-06 01:18:25 +00:00
|
|
|
constructor() {
|
|
|
|
super();
|
2022-09-29 18:05:44 +00:00
|
|
|
this.row_types = {
|
2022-09-30 10:55:02 +00:00
|
|
|
small: {size: 'vsmall'}
|
2022-09-29 18:05:44 +00:00
|
|
|
};
|
|
|
|
this.row_defs = [
|
|
|
|
{
|
|
|
|
type: 'large',
|
|
|
|
init_coords: [0.05,0.1],
|
|
|
|
row_direction: [0.0,1.0],
|
|
|
|
rows: 1
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'medium',
|
|
|
|
init_coords: [0.05,0.4],
|
|
|
|
row_direction: [0.0,1.0],
|
|
|
|
rows: 2
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'small',
|
|
|
|
init_coords: [0.05,0.9],
|
|
|
|
row_direction: [0.0,1.0],
|
|
|
|
rows: 1
|
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
|
|
|
formatDate(date){
|
|
|
|
var hours_txt = hoursToText(date.getHours());
|
|
|
|
var mins_txt = numberToText(date.getMinutes());
|
2022-09-29 18:05:44 +00:00
|
|
|
var date_txt = Locale.dow(date,1).toUpperCase() + " " + numberToText(date.getDate());
|
|
|
|
return [hours_txt,mins_txt[0],mins_txt[1],date_txt];
|
2022-08-06 01:18:25 +00:00
|
|
|
}
|
2022-09-29 18:05:44 +00:00
|
|
|
defaultRowTypes(){ return this.row_types;}
|
|
|
|
|
|
|
|
defaultRowDefs(){ return this.row_defs; }
|
2021-04-11 14:18:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = EnglishDateFormatter;
|