Refactors date handling to use DateService
Standardizes date manipulation across the application by leveraging the DateService. This change improves consistency and reduces code duplication by removing redundant date calculations.
This commit is contained in:
parent
6bbf2d8adb
commit
a86a736340
6 changed files with 69 additions and 77 deletions
|
|
@ -226,12 +226,7 @@ export class PositionUtils {
|
|||
*/
|
||||
public static timeStringToIso(timeString: string, date: Date = new Date()): string {
|
||||
const totalMinutes = PositionUtils.dateService.timeToMinutes(timeString);
|
||||
const hours = Math.floor(totalMinutes / 60);
|
||||
const minutes = totalMinutes % 60;
|
||||
|
||||
const newDate = new Date(date);
|
||||
newDate.setHours(hours, minutes, 0, 0);
|
||||
|
||||
const newDate = PositionUtils.dateService.createDateAtTime(date, totalMinutes);
|
||||
return newDate.toISOString();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue