@@ -1,6 +1,7 @@
|
||||
using Microsoft.Data.Sqlite;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.IO.Hashing;
|
||||
@@ -171,5 +172,12 @@ namespace Elwig.Helpers {
|
||||
grid.Children.Add(tb);
|
||||
}
|
||||
|
||||
public static (int Year, int Week) GetYearAndWeek(this DateTime date) {
|
||||
return (ISOWeek.GetYear(date), ISOWeek.GetWeekOfYear(date));
|
||||
}
|
||||
|
||||
public static (int Year, int Tertial) GetYearAndTertial(this DateTime date) {
|
||||
return (date.Month <= 7 ? date.Year - 1 : date.Year, date.Month == 12 || date.Month <= 3 ? 2 : date.Month <= 7 ? 3 : 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user