private XSDuration castYearMonthDuration(AnyAtomicType aat) { if (aat is XSDuration) { XSDuration duration = (XSDuration)aat; return(new XSYearMonthDuration(duration.year(), duration.month(), duration.negative())); } return(parseYMDuration(aat.StringValue)); }
public virtual Calendar normalizeCalendar(Calendar cal, XSDuration timezone) { Calendar adjusted = (Calendar)cal.clone(); if (timezone != null) { int hours = timezone.hours(); int minutes = timezone.minutes(); if (!timezone.negative()) { hours *= -1; minutes *= -1; } adjusted.AddHours(hours); adjusted.AddMinutes(minutes); } return(adjusted); }
private XSDuration castDayTimeDuration(AnyAtomicType aat) { if (aat is XSDuration) { XSDuration duration = (XSDuration)aat; return(new XSDayTimeDuration(duration.days(), duration.hours(), duration.minutes(), duration.seconds(), duration.negative())); } return(parseDTDuration(aat.StringValue)); }