/
vasiukoff
/
sg
Обзор
Документация
Войти
/
vasiukoff
/
sg
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Models/DateTimeFormat.cs
50 строк
2 KB
Nathan Baulch
typos: (#1397)
06 июн 2025, 07:10
Не верифицирован
06 июн 2025, 07:10
7bba40d
Код
Авторство
О чём код?
using System; using System.Collections.Generic; namespace SourceGit.Models { public class DateTimeFormat { public string DateOnly { get; set; } public string DateTime { get; set; } public string Example { get => _example.ToString(DateTime); } public DateTimeFormat(string dateOnly, string dateTime) { DateOnly = dateOnly; DateTime = dateTime; } public static int ActiveIndex { get; set; } = 0; public static DateTimeFormat Active { get => Supported[ActiveIndex]; } public static readonly List<DateTimeFormat> Supported = new List<DateTimeFormat> { new DateTimeFormat("yyyy/MM/dd", "yyyy/MM/dd, HH:mm:ss"), new DateTimeFormat("yyyy.MM.dd", "yyyy.MM.dd, HH:mm:ss"), new DateTimeFormat("yyyy-MM-dd", "yyyy-MM-dd, HH:mm:ss"), new DateTimeFormat("MM/dd/yyyy", "MM/dd/yyyy, HH:mm:ss"), new DateTimeFormat("MM.dd.yyyy", "MM.dd.yyyy, HH:mm:ss"), new DateTimeFormat("MM-dd-yyyy", "MM-dd-yyyy, HH:mm:ss"), new DateTimeFormat("dd/MM/yyyy", "dd/MM/yyyy, HH:mm:ss"), new DateTimeFormat("dd.MM.yyyy", "dd.MM.yyyy, HH:mm:ss"), new DateTimeFormat("dd-MM-yyyy", "dd-MM-yyyy, HH:mm:ss"), new DateTimeFormat("MMM d yyyy", "MMM d yyyy, HH:mm:ss"), new DateTimeFormat("d MMM yyyy", "d MMM yyyy, HH:mm:ss"), }; private static readonly DateTime _example = new DateTime(2025, 1, 31, 8, 0, 0, DateTimeKind.Local); } }