Skip to content

Commit cd071ec

Browse files
- clean scss suggestions;
- call confirm after adjacentDay is clicked;
1 parent 9949105 commit cd071ec

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

core/src/components/datetime/datetime.ios.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@
252252
* text color and be bolder.
253253
*/
254254
:host .calendar-day.calendar-day-active,
255-
:host .calendar-day.calendar-day-adjacent-day.calendar-day-active {
255+
:host .calendar-day.calendar-day-adjacent-day.calendar-day-active {
256256
color: current-color(base);
257257

258258
font-weight: 600;

core/src/components/datetime/datetime.md.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
* text color and be bolder.
119119
*/
120120
:host .calendar-day.calendar-day-active,
121-
:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{
121+
:host .calendar-day.calendar-day-adjacent-day.calendar-day-active {
122122
color: current-color(contrast);
123123
}
124124

core/src/components/datetime/datetime.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,32 +2380,25 @@ export class Datetime implements ComponentInterface {
23802380
return;
23812381
}
23822382

2383-
const targetValue = {
2384-
month: _month,
2385-
day,
2386-
year: _year,
2387-
isAdjacentDay,
2388-
};
2389-
23902383
if (isAdjacentDay) {
23912384
// The user selected a day outside the current month. Ignore this button, as the month will be re-rendered.
23922385
this.el.blur();
2393-
2394-
this.activeParts = targetValue;
2395-
this.animateToDate(targetValue);
2386+
this.activeParts = referenceParts;
2387+
this.animateToDate(referenceParts);
2388+
this.confirm();
23962389
} else {
23972390
this.setWorkingParts({
23982391
...this.workingParts,
2399-
...targetValue,
2392+
...referenceParts,
24002393
});
24012394

24022395
// multiple only needs date info, so we can wipe out other fields like time
24032396
if (multiple) {
2404-
this.setActiveParts(targetValue, isActive);
2397+
this.setActiveParts(referenceParts, isActive);
24052398
} else {
24062399
this.setActiveParts({
24072400
...activePart,
2408-
...targetValue,
2401+
...referenceParts,
24092402
});
24102403
}
24112404
}

0 commit comments

Comments
 (0)