init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
Kreta.BusinessLogic/Helpers/SystemSettings
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace Kreta.BusinessLogic.Helpers.SystemSettings
|
||||
{
|
||||
class SystemSettingDateConverter : DateTimeConverterBase
|
||||
{
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
DateTime date;
|
||||
if (DateTime.TryParse(reader.Value.ToString(), out date))
|
||||
{
|
||||
return date;
|
||||
}
|
||||
|
||||
var value = reader.Value.ToString().ToUpper();
|
||||
value = value.Replace("YYYY", "2000");
|
||||
value = value.Replace("MM", "01");
|
||||
value = value.Replace("DD", "01");
|
||||
|
||||
return DateTime.Parse(value);
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue