You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was testing the EwsUtilities.java page, while calling the TimeSpan getXSDurationToTimeSpan(String xsDuration) function noticed -
// Month
m = PATTERN_MONTH.matcher(xsDuration);
LOG.debug(m.find());
int month = 0;
if (m.find()) {
month = Integer.parseInt(m.group().substring(0,
m.group().indexOf("M")));
}
// Minute
m = PATTERN_MINUTES.matcher(xsDuration);
LOG.debug(m.find());
int minute = 0;
if (m.find()) {
minute = Integer.parseInt(m.group().substring(0,
m.group().indexOf("M")));
}
would generate the same value due to the same regular expression compiled into a pattern.
private static final Pattern PATTERN_MONTH = Pattern.compile("(\d+)M");
private static final Pattern PATTERN_MINUTES = Pattern.compile("(\d+)M");
Probably, one of them needs to be changed.
The text was updated successfully, but these errors were encountered:
It seems to be related to #357. All time zone periods with minutes in them are parsed in a wrong way.
For example TimeSpan for this one -PT3H30M will be parsed as:
negative true
year 0
month 30
day 0
hour 3
minute 30
seconds 0
The big M for months and minutes seems to be correct according to ISO 8601 and the only difference is 'T' in the middle. For example this one P1Y2M10DT2H30M is a correct Time interval.
I was testing the EwsUtilities.java page, while calling the TimeSpan getXSDurationToTimeSpan(String xsDuration) function noticed -
would generate the same value due to the same regular expression compiled into a pattern.
private static final Pattern PATTERN_MONTH = Pattern.compile("(\d+)M");
private static final Pattern PATTERN_MINUTES = Pattern.compile("(\d+)M");
Probably, one of them needs to be changed.
The text was updated successfully, but these errors were encountered: