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
It seems the setTimezone method of an RDate (this one), does not set the timezone of it's super-class (DateListProperty) when holding a non-empty list of periods. Is this wanted behavior and if so, why? It seems unexpected and would aid us in handling RDates with periods. :)
Below is the test for the method with a an addded assert statement, to show exactly what we mean.
Thank you and have a nice day!
public void testSetTimeZone() {
RDate rDate = new RDate(new PeriodList());
/*
try {
rDate.setTimeZone(timezone);
fail("Should throw UnsupportedOperationException");
}
catch (UnsupportedOperationException uoe) {
LOG.info("Caught exception: " + uoe.getMessage());
}
try {
rDate.setTimeZone(null);
fail("Should throw UnsupportedOperationException");
}
catch (UnsupportedOperationException uoe) {
LOG.info("Caught exception: " + uoe.getMessage());
}
*/
rDate.setTimeZone(timezone);
assertEquals(timezone, rDate.getPeriods().getTimeZone());
// Added this - I would expect the RDate to have the time zone, too
// because the ;TZID= is then generated from the RDate property
assertEquals(timezone, rDate.getTimeZone());
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello there ~
It seems the
setTimezone
method of anRDate
(this one), does not set the timezone of it's super-class (DateListProperty
) when holding a non-empty list of periods. Is this wanted behavior and if so, why? It seems unexpected and would aid us in handling RDates with periods. :)Below is the test for the method with a an addded assert statement, to show exactly what we mean.
Thank you and have a nice day!
Beta Was this translation helpful? Give feedback.
All reactions