Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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));
        }