// ---------------------------------------------------------------------- public static void ShowQuarter( Quarter quarter, string caption = "Quarter" ) { WriteLine( "{0}: {1}", caption, quarter ); WriteIndentLine( "YearBaseMonth: {0}", quarter.YearBaseMonth ); WriteIndentLine( "StartMonth: {0}", quarter.StartMonth ); WriteIndentLine( "Year: {0}", quarter.Year ); WriteIndentLine( "YearQuarter: {0}", quarter.YearQuarter ); WriteIndentLine( "IsCalendarQuarter: {0}", quarter.IsCalendarQuarter ); WriteIndentLine( "MultipleCalendarYears: {0}", quarter.MultipleCalendarYears ); WriteIndentLine( "QuarterName: {0}", quarter.QuarterName ); WriteIndentLine( "QuarterOfYearName: {0}", quarter.QuarterOfYearName ); WriteIndentLine( "FirstDayStart: {0}", Format( quarter.FirstDayStart ) ); WriteIndentLine( "LastDayStart: {0}", Format( quarter.LastDayStart ) ); WriteLine(); }
// ---------------------------------------------------------------------- public static void ShowAll( int periodCount, int startYear, YearQuarter yearQuarter, TimeCalendarConfig calendarConfig ) { WriteLine( "Input: count={0}, year={1}, quarter={2}", periodCount, startYear, yearQuarter ); WriteLine(); QuarterTimeRange quarterTimeRange; if ( periodCount == 1 ) { Quarter quarter = new Quarter( startYear, yearQuarter, new TimeCalendar( calendarConfig ) ); quarterTimeRange = quarter; Quarter previousQuarter = quarter.GetPreviousQuarter(); Quarter nextQuarter = quarter.GetNextQuarter(); ShowQuarter( quarter ); ShowCompactQuarter( previousQuarter, "Previous Quarter" ); ShowCompactQuarter( nextQuarter, "Next Quarter" ); WriteLine(); } else { Quarters quarters = new Quarters( startYear, yearQuarter, periodCount, new TimeCalendar( calendarConfig ) ); quarterTimeRange = quarters; ShowQuarters( quarters ); WriteLine(); foreach ( Quarter quarter in quarters.GetQuarters() ) { ShowCompactQuarter( quarter ); } WriteLine(); } foreach ( Month month in quarterTimeRange.GetMonths() ) { MonthDemo.ShowCompactMonth( month ); } WriteLine(); }
// ---------------------------------------------------------------------- public static void ShowCompactQuarter( Quarter quarter, string caption = "Quarter" ) { WriteLine( "{0}: {1}", caption, quarter ); }