Exemple #1
0
            /// <summary>
            /// Get last day of year for <paramref name="date"/> for year beginning on <paramref name="firstMonthOfYear"/>
            /// </summary>
            /// <param name="date">Date to check</param>
            /// <param name="firstMonthOfYear">First day of year (Often fiscal)</param>
            /// <returns>Date of last day of year</returns>
            public static DateTime YearEnd(DateTime date, SNetMonth firstMonthOfYear)
            {
                DateTime yearBegin = YearBegin(date, firstMonthOfYear);

                return(YearEnd(date, yearBegin));
            }
Exemple #2
0
 /// <summary>
 /// Return the calendar quarter for the current date for year starting in <paramref name="firstMonthOfYear"/>
 /// </summary>
 /// <param name="firstMonthOfYear">First of of year. (Often fiscal year)</param>
 /// <returns>Quarter number (1-4) for current date</returns>
 public static int Quarter(SNetMonth firstMonthOfYear)
 {
     return(Quarter(DateTime.Now, firstMonthOfYear));
 }
Exemple #3
0
 /// <summary>
 /// Get first day of year for <paramref name="date"/> for year beginning on <paramref name="firstMonthOfYear"/>
 /// </summary>
 /// <param name="date">Date to check</param>
 /// <param name="firstMonthOfYear">First Month of year (Often fiscal)</param>
 /// <returns>Date of first day of year</returns>
 public static DateTime YearBegin(DateTime date, SNetMonth firstMonthOfYear)
 {
     return(YearBegin(date, new DateTime(DateTime.MinValue.Year, monthToInt(firstMonthOfYear), 1)));
 }
Exemple #4
0
 /// <summary>
 /// Get last day of year for current datetime with year starting in <paramref name="firstMonthOfYear"/>
 /// </summary>
 /// <param name="firstMonthOfYear">last Month of year (Often fiscal)</param>
 /// <returns>Date of last day of year</returns>
 public static DateTime YearEnd(SNetMonth firstMonthOfYear)
 {
     return(YearEnd(DateTime.Now, firstMonthOfYear));
 }
Exemple #5
0
 /// <summary>
 /// Returns the first date of current quarter for the current date for year beginning in <paramref name="firstMonthOfYear"/>
 /// </summary>
 /// <param name="firstMonthOfYear">First Month of year. (Often fiscal)</param>
 /// <returns>Date of first Month of year</returns>
 public static DateTime QuarterBegin(SNetMonth firstMonthOfYear)
 {
     return(QuarterBegin(DateTime.Now, firstMonthOfYear));
 }
Exemple #6
0
 /// <summary>
 /// Get last date in quarter for year beginning on <paramref name="firstMonthOfYear"/>
 /// </summary>
 /// <param name="quarter">Quarter to check</param>
 /// <param name="dateInYear">Random date in year that quarter will belong to.  Used to determine correct returned year</param>
 /// <param name="firstMonthOfYear">First Month of year.  (Often fiscal)</param>
 /// <returns>DateTime of last day in quarter</returns>
 public static DateTime QuarterEnd(int quarter, DateTime dateInYear, SNetMonth firstMonthOfYear)
 {
     return(QuarterEnd(quarter, dateInYear, new DateTime(DateTime.MinValue.Year, monthToInt(firstMonthOfYear), 1)));
 }
            } //Quarter

            /// <summary>
            /// Return the calendar quarter for a specific date for year that begins on a specific month
            /// </summary>
            /// <param name="date">Date to check</param>
            /// <param name="firstMonthOfYear">First Month of year. (Often fiscal year)</param>
            /// <returns>Quarter number (1-4) for current date</returns>
            public static int Quarter(DateTime date, SNetMonth firstMonthOfYear)
            {
                return Quarter(date, new DateTime(date.Year, monthToInt(firstMonthOfYear), 1));
            }
            } //QuarterEnd

            /// <summary>
            /// End of current quarter of <paramref name="date"/> for year starting in <paramref name="firstMonthOfYear"/>
            /// </summary>
            /// <param name="date">Date to check</param>
            /// <param name="firstMonthOfYear">First Month in year. (Often fiscal year)</param>
            /// <returns>Last date in quarter</returns>
            public static DateTime QuarterEnd(DateTime date, SNetMonth firstMonthOfYear)
            {
                return QuarterEnd(date, new DateTime(DateTime.MinValue.Year, monthToInt(firstMonthOfYear), 1));

            }
 /// <summary>
 /// Get last day of year for <paramref name="date"/> for year beginning on <paramref name="firstMonthOfYear"/>
 /// </summary>
 /// <param name="date">Date to check</param>
 /// <param name="firstMonthOfYear">First day of year (Often fiscal)</param>
 /// <returns>Date of last day of year</returns>
 public static DateTime YearEnd(DateTime date, SNetMonth firstMonthOfYear)
 {
     DateTime yearBegin = YearBegin(date, firstMonthOfYear);
     return YearEnd(date, yearBegin);
 }
Exemple #10
0
 /// <summary>
 /// Return the calendar quarter for the current date for year starting in <paramref name="firstMonthOfYear"/>
 /// </summary>
 /// <param name="firstMonthOfYear">First of of year. (Often fiscal year)</param>
 /// <returns>Quarter number (1-4) for current date</returns>
 public static int Quarter(SNetMonth firstMonthOfYear)
 {
     return Quarter(DateTime.Now, firstMonthOfYear);
 }
Exemple #11
0
 /// <summary>
 /// Get last day of year for current datetime with year starting in <paramref name="firstMonthOfYear"/>
 /// </summary>
 /// <param name="firstMonthOfYear">last Month of year (Often fiscal)</param>
 /// <returns>Date of last day of year</returns>
 public static DateTime YearEnd(SNetMonth firstMonthOfYear)
 {
     return YearEnd(DateTime.Now, firstMonthOfYear);
 }
Exemple #12
0
 /// <summary>
 /// Get first day of year for <paramref name="date"/> for year beginning on <paramref name="firstMonthOfYear"/>
 /// </summary>
 /// <param name="date">Date to check</param>
 /// <param name="firstMonthOfYear">First Month of year (Often fiscal)</param>
 /// <returns>Date of first day of year</returns>
 public static DateTime YearBegin(DateTime date, SNetMonth firstMonthOfYear)
 {
     return YearBegin(date, new DateTime(DateTime.MinValue.Year, monthToInt(firstMonthOfYear), 1));
 }
Exemple #13
0
 /// <summary>
 /// Get last date in quarter for year beginning on <paramref name="firstMonthOfYear"/>
 /// </summary>
 /// <param name="quarter">Quarter to check</param>
 /// <param name="dateInYear">Random date in year that quarter will belong to.  Used to determine correct returned year</param>
 /// <param name="firstMonthOfYear">First Month of year.  (Often fiscal)</param>
 /// <returns>DateTime of last day in quarter</returns>
 public static DateTime QuarterEnd(int quarter, DateTime dateInYear, SNetMonth firstMonthOfYear)
 {
     return QuarterEnd(quarter, dateInYear, new DateTime(DateTime.MinValue.Year, monthToInt(firstMonthOfYear), 1));
 }
Exemple #14
0
            } //Quarter

            /// <summary>
            /// Return the calendar quarter for a specific date for year that begins on a specific month
            /// </summary>
            /// <param name="date">Date to check</param>
            /// <param name="firstMonthOfYear">First Month of year. (Often fiscal year)</param>
            /// <returns>Quarter number (1-4) for current date</returns>
            public static int Quarter(DateTime date, SNetMonth firstMonthOfYear)
            {
                return(Quarter(date, new DateTime(date.Year, monthToInt(firstMonthOfYear), 1)));
            }
Exemple #15
0
 private static int monthToInt(SNetMonth month)
 {
     return (int)month;
 }
Exemple #16
0
 private static int monthToInt(SNetMonth month)
 {
     return((int)month);
 }
Exemple #17
0
 /// <summary>
 /// Returns the first date of current quarter for the current date for year beginning in <paramref name="firstMonthOfYear"/>
 /// </summary>
 /// <param name="firstMonthOfYear">First Month of year. (Often fiscal)</param>
 /// <returns>Date of first Month of year</returns>
 public static DateTime QuarterBegin(SNetMonth firstMonthOfYear)
 {
     return QuarterBegin(DateTime.Now, firstMonthOfYear);
 }