Datetime variables default to current time when typing 0 (zero) in the date or month fields

verified

#1

Background: When testing a piston, I was setting a datetime variable manually, but each time that I try to set it, it defaults to the current date/time if I typed a zero (0) in the date or month field.

Steps to replicate behavior:

  1. Open Piston to Edit mode
  2. Click add new global variable
  3. Select type “Date and Time”
  4. Enter any variable name
  5. Click add
  6. Click on the variable name
  7. Change date/time to any date/time
  8. Click into the month (or date) field
  9. Type a month (or date) that begins with a zero (ie. 05 or 09)

Actual Behavior
Date/time changes from set value to current date/time

Desired Behavior
Date/Time changes to entered date/month (does not change to current date/time)

Note
This may be a case of “functioning as designed”. If so, feel free to mark this as completed.


#2

Good observation, this is definitely a problem and I’ll see if it can be fixed for the next release. I suspect that the problem is caused by webCoRE interpreting the value of the date on every keystroke and also updating the value of that field based on that keystroke (which in this case is an invalid date). The browser’s date field should instead be allowed to do its thing handling user input and only pull that value out once the field is no longer being edited.

As a temporary workaround please type only the single digit without leading zero for any dates or times less than 10.


#3

The problem described above seems to be the cause here and delaying updates to the value until the field is no longer being edited seems to be the solution. I will add this to the release that the minions are testing!