Bug #927
The shell's start/end date formatting ought to be more lenient
0%
Description
Requested by Chad. The parsing of Start and End dates should allow the single-digit version of Month and Day. For example ...
starttime=2015-02-01T00:00:00
could also be submitted as ...
starttime=2015-02-1T00:00:00 or starttime=2015-2-01T00:00:00, or both.
Right now the shell throws an ...
Error 400: doIrisProcessing - Bad date value for .. etc.
You can repro this in Station for example. All this time, in all my services, I had a method like so using the Joda dateOptionalTimeParser which handles the single digit cases. But now I see I was fooled: With a single-digit entry, I never get out of the shell and enter this method. =D
public static Timestamp parseFdsnTime(String in) {
DateTimeFormatter fmt = ISODateTimeFormat.dateOptionalTimeParser().withZone(DateTimeZone.UTC);
Timestamp ts = null;
if (null != in && in.length() > 0) {
DateTime startTime = fmt.parseDateTime(in);
ts = new java.sql.Timestamp(startTime.getMillis());
}
return ts;
}
History
#1 Updated by Mike Stults over 6 years ago
- Resolution set to Fixed
2018-05-17 35383ca "issue 927 - allow single digit for month or day, also allow time zone in the form of + or - hh:mm"
note this is an extension of the existing parameter testing which uses regex, rather than introduce joda time, or java 8 java.time.
#2 Updated by Mike Stults over 6 years ago
- Target version set to 2.4.4
2018-05-25 5a3b275 (Mike Stults): (HEAD > master, tag: v2.4.4, origin/master, origin/HEAD) - v2.4.4 for issues 939, 931, 927, 894, 841
uploaded webserviceshell/2.4.4/webserviceshell-2.4.4.jar 8545 KB
#3 Updated by Mick Van Fossen over 6 years ago
Confirmed in 2.4.4. (I don't have permissions to set this bug as "Closed")