Is there a way for me to update the time of a Subject within my service?
I'm considering abstracting this function into a service:
date: Date;
setTime(hours: number, mins: number, secs: number): void {
this.date.setHours(hours);
this.date.setMinutes(mins);
this.date.setSeconds(secs);
}
service example
date: Subject<Date>;
constructor() {
this.date = new Subject();
}
setDate(hrs: number, mins: number, secs: number): Observable<Date> {
const tempDate = this.date;
// tempDate.set - Cannot perform .setXXX here as it is a Subject and not a Date
this.date.next
}