Mike Phares 538b1f817e Align .editorconfig files
When debugging only
app.Services.GetRequiredService<IPCRBService>();

Injected AppSettings instead of using GetEnvironmentVariable at Services level

Get ready to use VSCode IDE
2024-12-03 12:23:56 -07:00

24 lines
875 B
C#

namespace MesaFabApproval.Shared.Utilities;
public class DateTimeUtilities {
public static DateTime MIN_DT = new DateTime(1753, 1, 1, 0, 0, 0);
public static DateTime MAX_DT = new DateTime(9999, 12, 31, 11, 59, 59);
public static string GetDateAsStringMinDefault(DateTime dt) {
return dt > MIN_DT ? dt.ToString("yyyy-MM-dd HH:mm") : "";
}
public static string GetDateAsStringMinDefault(DateTime? dt) {
DateTime copy = dt ?? MIN_DT;
return copy > MIN_DT ? copy.ToString("yyyy-MM-dd HH:mm") : "";
}
public static string GetDateAsStringMaxDefault(DateTime dt) {
return dt < MAX_DT ? dt.ToString("yyyy-MM-dd HH:mm") : "";
}
public static string GetDateAsStringMaxDefault(DateTime? dt) {
DateTime copy = dt ?? MAX_DT;
return copy < MAX_DT ? copy.ToString("yyyy-MM-dd HH:mm") : "";
}
}