You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { observable } from "mobx";
|
|
|
|
|
|
|
|
export class TimeOfDay {
|
|
|
|
readonly hour: number;
|
|
|
|
readonly minute: number;
|
|
|
|
readonly second: number;
|
|
|
|
readonly millisecond: number;
|
|
|
|
|
|
|
|
constructor(hour: number, minute: number = 0, second: number = 0, millisecond: number = 0) {
|
|
|
|
this.hour = hour;
|
|
|
|
this.minute = minute;
|
|
|
|
this.second = second;
|
|
|
|
this.millisecond = millisecond;
|
|
|
|
}
|
|
|
|
|
|
|
|
static fromDate(date: Date): TimeOfDay {
|
|
|
|
return new TimeOfDay(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum Weekday {
|
|
|
|
Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday,
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Schedule {
|
|
|
|
@observable times: TimeOfDay[] = [];
|
|
|
|
@observable weekdays: Weekday[] = [];
|
|
|
|
@observable from: Date | null = null;
|
|
|
|
@observable to: Date | null = null;
|
|
|
|
}
|