Skip to content

Commit

Permalink
fix: Scheduled date picker always points to today, regardless of a pr…
Browse files Browse the repository at this point in the history
…evious date (logseq#7329)

* fix: Scheduled date picker always points to today, regardless if a previous date was already set
fixes logseq#6985

* fix: e2e-test flakyness for datepicker
  • Loading branch information
sallto authored Nov 15, 2022
1 parent 3de6f3d commit e882b7c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions e2e-tests/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,22 @@ test('invalid page props #3944', async ({ page, block }) => {
// Force rendering property block
await block.enterNext()
})

test('Scheduled date picker should point to the already specified Date #6985', async({page,block})=>{
await createRandomPage(page)

await block.mustFill('testTask \n SCHEDULED: <2000-05-06 Sat>')
await block.enterNext()
await page.waitForTimeout(500)
await block.escapeEditing()

// Open date picker
await page.click('a.opacity-80')
await page.waitForTimeout(500)
expect(page.locator('text=May 2000')).toBeVisible()
expect(page.locator('td:has-text("6").active')).toBeVisible()

// Close date picker
await page.click('a.opacity-80')
await page.waitForTimeout(500)
})
2 changes: 1 addition & 1 deletion src/main/frontend/components/datetime.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
(reset! *timestamp {:time ""
:repeater {}}))
(when-not (:date-picker/date @state/state)
(state/set-state! :date-picker/date (t/today))))
(state/set-state! :date-picker/date (get ts :date (t/today)))))
state)
:will-unmount (fn [state]
(clear-timestamp!)
Expand Down

0 comments on commit e882b7c

Please sign in to comment.