Skip to content

Commit

Permalink
fix: correctly change date when switching day period (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeraS committed Mar 27, 2024
1 parent ce19b43 commit 43dc35a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/DateField/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export function getDurationUnitFromSectionType(type: DateFieldSectionType) {
export function addSegment(section: DateFieldSection, date: DateTime, amount: number) {
let val = section.value ?? 0;
if (section.type === 'dayPeriod') {
val = date.hour() + (date.hour() > 12 ? -12 : 12);
val = date.hour() + (date.hour() >= 12 ? -12 : 12);
} else {
val = val + amount;
const min = section.minValue;
Expand Down

0 comments on commit 43dc35a

Please sign in to comment.