getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.27k stars 167 forks source link

Date field behaves weird when "display" MM/YYYY is used #6408

Open mit-stauffer opened 5 months ago

mit-stauffer commented 5 months ago

Description

When displaying a date field in the panel in the format MM/YYYY, the date input jumps to 08/2025 after saving, no matter what I selected. No other options are used (except width). Tried it in the 4.2 startkit

datetest:
   type: date
   display: MM/YYYY
   width: 1/4

The content .txt files saves the wrong date: Datetest: 2025-08-01

jhogervorst commented 1 month ago

I'm having the same issue. I'm using Kirby 4.3.0 with the following field configuration:

published:
  label: Maand van uitgave
  type: date
  required: true
  display: MM-YYYY
  calendar: false
  step: month

The issue occurs both in the page creation dialog, as well as in the regular page editor in the panel. Here's a short recording; you can see that as soon as I click outside (blur) the date input field, the typed value 01-2024 is changed to 08-2025:

CleanShot 2024-08-06 at 12 54 05

I've noticed that as a workaround, you can type the full date (DD-MM-YYYY) instead of only the month (MM-YYYY), in which case it works correctly:

CleanShot 2024-08-06 at 12 56 41

silllli commented 1 month ago

Same issue here. This is a bit nasty, since the date jumps when closing the drawer … easy to miss!

Edit: My workaround for the moment is using MM YYYY instead of MM/YYYY.