JPHD-2021-backend/Utils/DateHelper.cs

76 lines
1.9 KiB
C#

using _2021_backend.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace _2021_backend.Utils
{
public class DateHelper
{
public static bool CheckDate()
{
if (DateTime.Now.CompareTo(new DateTime(2021, 9, 28)) < 0) return true;
return false;
}
public static string GetDay(int day)
{
switch (day)
{
case 1:
return "24日";
case 2:
return "25日";
case 3:
return "26日";
case 4:
return "27日";
case 5:
return "28日";
case 6:
return "29日";
case 7:
return "30日";
default:
return "暂无";
}
}
public static string GetGrade(int grade)
{
switch (grade)
{
case 1:
return "大一";
case 2:
return "大二";
case 3:
return "大三";
case 4:
return "大四";
default:
return "暂缺";
}
}
public static string GetEtc(int etc)
{
switch (etc)
{
case 1:
return "第一场";
case 2:
return "第二场";
case 3:
return "第三场";
case 4:
return "第四场";
case 5:
return "第五场";
default:
return "暂无";
}
}
}
}