Пример #1
0
        private static int ToDateTimeMonth( Calendar calendar, DateTime value )
        {
            Contract.Requires( calendar != null );
            Contract.Ensures( Contract.Result<int>() > 0 );

            var epoch = calendar.FirstMonthOfYear();
            var month = calendar.GetMonth( value );
            var actual = ( epoch + month ) - 1;

            return actual > 12 ? ( actual - 12 ) : actual;
        }