Fix small inconsistency when picker is open for multiple minutes
This commit is contained in:
parent
96bc6fc789
commit
93630b36e2
|
@ -34,7 +34,7 @@
|
||||||
const now = dayjs()
|
const now = dayjs()
|
||||||
let calendarDate
|
let calendarDate
|
||||||
|
|
||||||
$: calendarDate = dayjs(value || now).startOf("month")
|
$: calendarDate = dayjs(value || dayjs()).startOf("month")
|
||||||
$: mondays = getMondays(calendarDate)
|
$: mondays = getMondays(calendarDate)
|
||||||
|
|
||||||
const getMondays = monthStart => {
|
const getMondays = monthStart => {
|
||||||
|
|
|
@ -6,9 +6,7 @@
|
||||||
export let value
|
export let value
|
||||||
export let onChange
|
export let onChange
|
||||||
|
|
||||||
const now = dayjs()
|
$: displayValue = value || dayjs()
|
||||||
|
|
||||||
$: displayValue = value || now
|
|
||||||
|
|
||||||
const handleHourChange = e => {
|
const handleHourChange = e => {
|
||||||
onChange(displayValue.hour(parseInt(e.target.value)))
|
onChange(displayValue.hour(parseInt(e.target.value)))
|
||||||
|
|
Loading…
Reference in New Issue