Created
May 28, 2019 07:16
-
-
Save mustmodify/c8664a965a6d949708af2a59e262596b to your computer and use it in GitHub Desktop.
C# files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
namespace ProBill | |
{ | |
public class Week | |
{ | |
public int Year; | |
public int WeekOfYear; | |
public Week() | |
{ | |
} | |
public Week(short year, short week) | |
{ | |
this.Year = year; | |
this.WeekOfYear = week; | |
} | |
public Week Including( DateTime Date ) | |
{ | |
Week output = new Week(); | |
GregorianCalendar cal = new GregorianCalendar(GregorianCalendarTypes.Localized); | |
output.Year = Date.Year; | |
output.WeekOfYear = cal.GetWeekOfYear(Date, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday); | |
return( output ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment