Opened 6 years ago

Closed 6 years ago

#519 closed defect (fixed)

Date fields should not allow 6-digit dates

Reported by: Nicklas Nordborg Owned by: olle
Priority: trivial Milestone: Reggie v2.13
Component: net.sf.basedb.reggie Keywords:
Cc:

Description

In all wizards that include date fields, the instructions are that dates can be entered in YYYYMMDD or MMDD format. In the latter case the current year is automatically added to the final date.

However, the implementation that add the year also allow dates in YYMMDD format and add either 19 or 20 so that the date is always within that last 100 years.

Since the latter behavior has caused incorrect dates to be entered in at least one case. Eg. 201212 was converted to 19201212 when the real date was 20121212.

Suggested fix is to remove support for 6-digit dates in all places. The actual implementation may still allow it but this could for example be controlled by adding a second (boolean) parameter to the autoFillDate() function in reggie.js

Change History (7)

comment:1 Changed 6 years ago by olle

Owner: changed from Nicklas Nordborg to olle

comment:2 Changed 6 years ago by olle

Status: newassigned

Ticket accepted.

comment:3 Changed 6 years ago by olle

(In [2084]) Refs #519. Reggie updated to not auto-fill 6-digit date entries by default:

  1. JavaScript reggie.js in reggie/resources/ updated in function autoFillDate(shortDate) to accept a second argument allowSixDigitDates, which by default is set to false. Six-digit dates are now auto-filled only if argument allowSixDigitDates has value true.

comment:4 Changed 6 years ago by olle

Resolution: fixed
Status: assignedclosed

Ticket closed as the fix suggested in the ticket description has been implemented.

comment:5 Changed 6 years ago by Nicklas Nordborg

Resolution: fixed
Status: closedreopened

Reopening this ticket. The two blood registration wizards should allow 6-digit dates to be used. The reason is that those referral forms are often registered much later than when the blood sample was taken, so that the auto-completion from 4-digit values may not be able to guess the correct year.

comment:6 Changed 6 years ago by olle

(In [2139]) Refs #519. Refs #449. The two blood registration wizards updated to allow 6-digit dates to be used:

  1. JSP script bloodform.jsp in reggie/resources/personal/ updated in functions samplingDateTimeOnChange() and freezerDateTimeOnChange() to call function autoFillDate(shortDate, allowSixDigitDates) in reggie.js in reggie/resources/ with argument allowSixDigitDates set to true.
  2. JSP script bloodfollowupform.jsp in reggie/resources/personal/ updated in functions samplingDateTimeOnChange() and freezerDateTimeOnChange() to call function autoFillDate(shortDate, allowSixDigitDates) in reggie.js in reggie/resources/ with argument allowSixDigitDates set to true.

comment:7 Changed 6 years ago by olle

Resolution: fixed
Status: reopenedclosed

Ticket closed again after updating the two blood registration wizards to allow 6-digit dates.

Note: See TracTickets for help on using tickets.