V1.2
This commit is contained in:
1 parent
7fc7653e6f
commit
d8759eee29
25 files changed
+318
-121
No files matched your search
@@ -1,6 +1,4 @@
|
||||
import { Injectable, signal, PLATFORM_ID, inject } from '@angular/core';
|
||||
import { isPlatformBrowser } from '@angular/common';
|
||||
import Holidays, { HolidaysTypes } from 'date-holidays';
|
||||
import { VacationsNumber } from './calendar-service';
|
||||
|
||||
|
||||
@@ -9,24 +7,16 @@ import { VacationsNumber } from './calendar-service';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UserInputService {
|
||||
private platformId = inject(PLATFORM_ID);
|
||||
|
||||
private getRandomNumber(): number {
|
||||
return Math.floor(Math.random() * 9) + 1;
|
||||
}
|
||||
|
||||
private getInitialValues(): VacationsNumber {
|
||||
if (isPlatformBrowser(this.platformId)) {
|
||||
return {
|
||||
cp: this.getRandomNumber(),
|
||||
rtt: this.getRandomNumber(),
|
||||
other: this.getRandomNumber()
|
||||
};
|
||||
}
|
||||
return {
|
||||
cp: 0,
|
||||
rtt: 0,
|
||||
other: 0
|
||||
cp: this.getRandomNumber(),
|
||||
rtt: this.getRandomNumber(),
|
||||
other: this.getRandomNumber()
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user