Skip to content

Commit

Permalink
revert changes for newValue variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sumeyyeKurtulus committed Mar 6, 2024
1 parent a602c19 commit ab1a12f
Showing 1 changed file with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,27 @@ export class DateTimeAdapter {
return '';
}

const now = new Date();

const newValue = {
year: now.getUTCFullYear(),
month: now.getMonth() + 1,
day: now.getDate(),
hour: 0,
minute: 0,
second: 0,
...this.value,
...value,
} as NgbDateTimeStruct;

const date = new Date(
Date.UTC(
value.year,
value.month - 1,
value.day,
value?.hour || 0,
value?.minute || 0,
value?.second || 0,
newValue.year,
newValue.month - 1,
newValue.day,
newValue.hour,
newValue.minute,
newValue.second,
),
);

Expand Down

0 comments on commit ab1a12f

Please sign in to comment.