initial project commit
This commit is contained in:
20
Habitica.Todoist.Integration.Model/Todoist/Due.cs
Normal file
20
Habitica.Todoist.Integration.Model/Todoist/Due.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Todoist
|
||||
{
|
||||
public class Due
|
||||
{
|
||||
public string Date { get; set; }
|
||||
public string Timezone { get; set; }
|
||||
public string @String { get; set; }
|
||||
|
||||
public string ToJavaScriptDateStr()
|
||||
{
|
||||
try { return Date + "T00:00:00.000Z"; } catch { }
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
26
Habitica.Todoist.Integration.Model/Todoist/Item.cs
Normal file
26
Habitica.Todoist.Integration.Model/Todoist/Item.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Todoist
|
||||
{
|
||||
public class Item
|
||||
{
|
||||
public string Content { get; set; }
|
||||
public string Id { get; set; }
|
||||
public Due Due { get; set; }
|
||||
public int Is_deleted { get; set; }
|
||||
public string Date_completed { get; set; }
|
||||
|
||||
public int? GetDifficulty()
|
||||
{
|
||||
try { return int.Parse(Content.Split('-').Last().Last().ToString()); } catch { }
|
||||
return null;
|
||||
}
|
||||
|
||||
public string GetCleanContent()
|
||||
{
|
||||
try { return Content.Split('-').First(); } catch { }
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Habitica.Todoist.Integration.Model/Todoist/SyncResponse.cs
Normal file
13
Habitica.Todoist.Integration.Model/Todoist/SyncResponse.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Todoist
|
||||
{
|
||||
public class SyncResponse
|
||||
{
|
||||
public string Sync_token { get; set; }
|
||||
public bool Full_sync { get; set; }
|
||||
public List<Item> Items { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user