Skip to content

Commit 43dc35a

Browse files
authored
fix: correctly change date when switching day period (#60)
1 parent ce19b43 commit 43dc35a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/DateField/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export function getDurationUnitFromSectionType(type: DateFieldSectionType) {
242242
export function addSegment(section: DateFieldSection, date: DateTime, amount: number) {
243243
let val = section.value ?? 0;
244244
if (section.type === 'dayPeriod') {
245-
val = date.hour() + (date.hour() > 12 ? -12 : 12);
245+
val = date.hour() + (date.hour() >= 12 ? -12 : 12);
246246
} else {
247247
val = val + amount;
248248
const min = section.minValue;

0 commit comments

Comments
 (0)