Implement front end location/time/weather etc

This commit is contained in:
Dale Davies
2022-02-08 23:05:56 +00:00
parent 36f44fb266
commit 6d5366147f
19 changed files with 275 additions and 150 deletions

View File

@@ -0,0 +1,18 @@
export default class Clock {
constructor(utcshift = 0) {
this.utcshift = utcshift*1000;
this.shiftedtimestamp = new Date().getTime()+this.utcshift;
this.shifteddate = new Date(this.shiftedtimestamp);
}
get_formatted_time() {
const hour = String(this.shifteddate.getHours()).padStart(2, "0");
const minutes = String(this.shifteddate.getMinutes()).padStart(2, "0");
return hour + ":" + minutes;
}
get_hour() {
return this.shifteddate.getHours();
}
}