Пример #1
0
        public OrdinalDateTimeDuration(int years, int days, int hours, double minutes)
        {
            if (years < 0 || years >= 10000)
            {
                throw new ArgumentOutOfRangeException(nameof(years), "Years must be a number between 0 and 9999.");
            }

            if (days < 0 || days > 999)
            {
                throw new ArgumentOutOfRangeException(nameof(days), "Days must be a number between 0 and 999.");
            }

            if (hours < 0 || hours > 24)
            {
                throw new ArgumentOutOfRangeException(nameof(hours), "Hours must be a number between 0 and 24.");
            }

            if (minutes < 0 || minutes > 60)
            {
                throw new ArgumentOutOfRangeException(nameof(minutes), "Minutes must be a number between 0 and 60.");
            }

            _dateDuration = new OrdinalDateDuration(years, days);
            _timeDuration = new TimeDuration(hours, minutes);
        }
Пример #2
0
 internal OrdinalDateTimeDuration(OrdinalDateDuration dateDuration, TimeDuration timeDuration)
 {
     _dateDuration = dateDuration;
     _timeDuration = timeDuration;
 }