Get the latest commit and show it on the home page
This commit is contained in:
parent
ffb3e791ab
commit
5d67e92245
23 changed files with 233 additions and 60 deletions
25
Website/Extensions/DateTimeExtensions.cs
Normal file
25
Website/Extensions/DateTimeExtensions.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
|
||||
namespace Website.Extensions {
|
||||
public static class DateTimeExtensions {
|
||||
private static string GetDaySuffix(int day) {
|
||||
switch (day) {
|
||||
case 1:
|
||||
case 21:
|
||||
case 31:
|
||||
return @"\s\t";
|
||||
case 2:
|
||||
case 22:
|
||||
return @"\n\d";
|
||||
case 3:
|
||||
case 23:
|
||||
return @"\r\d";
|
||||
default:
|
||||
return @"\t\h";
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetDaySuffix(this DateTime dateTime) => GetDaySuffix(dateTime.Day);
|
||||
public static string GetDaySuffix(this DateTimeOffset dateTimeOffset) => GetDaySuffix(dateTimeOffset.Day);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue