Fix Bug นำเข้าข้อมูลสมัครสอบแข่งขัน
This commit is contained in:
parent
8a3df45c03
commit
eec08ab7b3
6 changed files with 1802 additions and 83 deletions
|
|
@ -392,10 +392,24 @@ namespace BMA.EHR.Recruit.Service.Services
|
|||
public DateTime CheckDateTime(string Date, string Formate)
|
||||
{
|
||||
// ตอนนี้ทำไว้ให้รองรับแค่ "dd/MM/yyyy", "yyyy-MM-dd"
|
||||
Date = Date.Trim();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Date))
|
||||
return DateTime.MinValue;
|
||||
|
||||
// กรณีอยู่ในรูปแบบ string double
|
||||
if (double.TryParse(Date, out double oaDate))
|
||||
{
|
||||
try
|
||||
{
|
||||
Date = DateTime.FromOADate(oaDate).ToString(Formate);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Date = DateTime.MinValue.ToString(Formate);
|
||||
}
|
||||
}
|
||||
|
||||
string[] parts = Date.Trim().Replace("-", "/").Split("/");
|
||||
|
||||
if (parts.Length != 3)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue