Inheritance: Itenso.TimePeriod.TimeCalendar
Example #1
0
        // ----------------------------------------------------------------------
        public void FiscalYearTimePeriodsSample()
        {
            DateTime           moment         = new DateTime(2011, 8, 15);
            FiscalTimeCalendar fiscalCalendar = new FiscalTimeCalendar();

            Console.WriteLine("Fiscal Year Periods of {0}:", moment.ToString("d"));
            // > Fiscal Year Periods of 15.08.2011:
            Console.WriteLine("Year     : {0}", new Year(moment, fiscalCalendar));
            Console.WriteLine("Halfyear : {0}", new Halfyear(moment, fiscalCalendar));
            Console.WriteLine("Quarter  : {0}", new Quarter(moment, fiscalCalendar));
            // > Year     : FY2010; 01.10.2010 - 30.09.2011 | 364.23:59
            // > Halfyear : FHY2 2010; 01.04.2011 - 30.09.2011 | 182.23:59
            // > Quarter  : FQ4 2010; 01.07.2011 - 30.09.2011 | 91.23:59
        }         // FiscalYearTimePeriodsSample
Example #2
0
        // ----------------------------------------------------------------------
        public void FiscalYearSample()
        {
            FiscalTimeCalendar calendar = new FiscalTimeCalendar();             // use fiscal periods

            DateTime moment1 = new DateTime(2006, 9, 30);

            Console.WriteLine("Fiscal Year of {0}: {1}", moment1.ToString("d"), new Year(moment1, calendar).YearName);
            // > Fiscal Year of 30.09.2006: FY2005
            Console.WriteLine("Fiscal Quarter of {0}: {1}", moment1.ToString("d"), new Quarter(moment1, calendar).QuarterOfYearName);
            // > Fiscal Quarter of 30.09.2006: FQ4 2005

            DateTime moment2 = new DateTime(2006, 10, 1);

            Console.WriteLine("Fiscal Year of {0}: {1}", moment2.ToString("d"), new Year(moment2, calendar).YearName);
            // > Fiscal Year of 01.10.2006: FY2006
            Console.WriteLine("Fiscal Quarter of {0}: {1}", moment1.ToString("d"), new Quarter(moment2, calendar).QuarterOfYearName);
            // > Fiscal Quarter of 30.09.2006: FQ1 2006
        }         // FiscalYearSample
Example #3
0
 public void FiscalYearTimePeriodsSample()
 {
     DateTime moment = new DateTime( 2011, 8, 15 );
     FiscalTimeCalendar fiscalCalendar = new FiscalTimeCalendar();
     Console.WriteLine( "Fiscal Year Periods of {0}:", moment.ToShortDateString() );
     // > Fiscal Year Periods of 15.08.2011:
     Console.WriteLine( "Year     : {0}", new Year( moment, fiscalCalendar ) );
     Console.WriteLine( "Halfyear : {0}", new Halfyear( moment, fiscalCalendar ) );
     Console.WriteLine( "Quarter  : {0}", new Quarter( moment, fiscalCalendar ) );
     // > Year     : FY2010; 01.10.2010 - 30.09.2011 | 364.23:59
     // > Halfyear : FHY2 2010; 01.04.2011 - 30.09.2011 | 182.23:59
     // > Quarter  : FQ4 2010; 01.07.2011 - 30.09.2011 | 91.23:59
 }
Example #4
0
        public void FiscalYearSample()
        {
            FiscalTimeCalendar calendar = new FiscalTimeCalendar(); // use fiscal periods

            DateTime moment1 = new DateTime( 2006, 9, 30 );
            Console.WriteLine( "Fiscal Year of {0}: {1}", moment1.ToShortDateString(), new Year( moment1, calendar ).YearName );
            // > Fiscal Year of 30.09.2006: FY2005
            Console.WriteLine( "Fiscal Quarter of {0}: {1}", moment1.ToShortDateString(), new Quarter( moment1, calendar ).QuarterOfYearName );
            // > Fiscal Quarter of 30.09.2006: FQ4 2005

            DateTime moment2 = new DateTime( 2006, 10, 1 );
            Console.WriteLine( "Fiscal Year of {0}: {1}", moment2.ToShortDateString(), new Year( moment2, calendar ).YearName );
            // > Fiscal Year of 01.10.2006: FY2006
            Console.WriteLine( "Fiscal Quarter of {0}: {1}", moment1.ToShortDateString(), new Quarter( moment2, calendar ).QuarterOfYearName );
            // > Fiscal Quarter of 30.09.2006: FQ1 2006
        }