Opened 10 years ago
Closed 10 years ago
#607 closed Request (fixed)
Date /time format is different in configuration file and GUI
Reported by: | Nicklas Nordborg | Owned by: | olle |
---|---|---|---|
Priority: | trivial | Milestone: | LabEnv v1.2 |
Component: | net.sf.basedb.labenv | Keywords: | |
Cc: |
Description
In labenv-config.xml the <startdate> must be entered in YYYY-MM-DD format, but <starttime> and <endtime> for alarms are entered as HHMM (I expected HH:MM).
When using the web interface dates are entered in YYYYMMDD format and times are entered in HHMM format.
I think date and time formats should be consistent and suggest that dates/times without any separators are supported everywhere (could still support YYYY-MM-DD by simply removing all '-' in the string).
Change History (5)
comment:1 by , 10 years ago
Status: | new → assigned |
---|
comment:2 by , 10 years ago
Traceability note:
- The lab environment extension was introduced in Ticket #529 (Retrieve and store temperature and humidity measurements).
- The lab environment extension was updated in Ticket #592 (Lab environment extension improved report routines), specifically regarding graphs of lab environment data for a chosen time interval, new time filters, and improved alarm functionality.
comment:3 by , 10 years ago
Design update:
- The lab environment extension configuration file should accept lab sensor start date both in YYYYMMDD and YYYY-MM-DD format. It will be stored in YYYY-MM-DD format, since this simplifies readability of simple print-out in lab sensor info page and logs.
- The lab environment extension configuration file should accept alarm start and end times in HHMM, HH:MM, HHMMSS, and HH:MM:SS formats. It will be stored in HHMM format (if seconds have been specified, these will be skipped, i.e. the minute entry will not be incremented if the number of seconds >= 30.
Implementation:
- Class/file
LabEnvironmentConfiguration.java
insrc/net/sf/basedb/labenv/
updated:
a. Private methodvoid fetchConfiguration()
updated to call new private convenience methodString convertToDateStringWithHyphens(String dateStr)
to convert input sensor start date to format YYYY-MM-DD.
b. Private methodList<LabSensorAlarmConfig> fetchLabSensorAlarmList(Element labSensorTag, Namespace ns)
updated to call new private convenience methodString convertToTimeStringInFormatHHMM(String timeStr)
to convert input alarm start and end times to HHMM format.
c. New private convenience methodString convertToDateStringWithHyphens(String dateStr)
added. It converts input date string from format YYYYMMDD to YYYY-MM-DD, if necessary.
d. New private convenience methodString convertToTimeStringInFormatHHMM(String timeStr)
added. It converts input time string from formats HHMMSS, HH:MM:SS, and HH:MM to HHMM, if necessary. If input time contains seconds, the latter will be dropped, i.e. the minute entry will not be incremented if the number of seconds >= 30.
comment:4 by , 10 years ago
(In [2532]) Refs #607. Lab environment extension configuration file updated to accept lab sensor start date both in YYYYMMDD and YYYY-MM-DD format, and alarm start and end times in HHMM, HH:MM, HHMMSS, and HH:MM:SS formats:
- Class/file
LabEnvironmentConfiguration.java
insrc/net/sf/basedb/labenv/
updated:
a. Private methodvoid fetchConfiguration()
updated to call new private convenience methodString convertToDateStringWithHyphens(String dateStr)
to convert input sensor start date to format YYYY-MM-DD.
b. Private methodList<LabSensorAlarmConfig> fetchLabSensorAlarmList(Element labSensorTag, Namespace ns)
updated to call new private convenience methodString convertToTimeStringInFormatHHMM(String timeStr)
to convert input alarm start and end times to HHMM format.
c. New private convenience methodString convertToDateStringWithHyphens(String dateStr)
added. It converts input date string from format YYYYMMDD to YYYY-MM-DD, if necessary.
d. New private convenience methodString convertToTimeStringInFormatHHMM(String timeStr)
added. It converts input time string from formats HHMMSS, HH:MM:SS, and HH:MM to HHMM, if necessary. If input time contains seconds, the latter will be dropped, i.e. the minute entry will not be incremented if the number of seconds >= 30.
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Ticket closed since the lab extension configuration file now accepts date and time entries in several formats.
Ticket accepted.