public override DateTime?ConvertToDate(String value) { var time = ConvertFromTime(value); if (time == null) { return(null); } return(UnixEpoch.Add(time.Value.Subtract(new DateTime()))); }
public ReminderData ToReminderData() { ReminderData data = new ReminderData(null, Id) { SelectedDate = UnixEpoch.Add(TimeSpan.FromSeconds(UnixSelectedDate)), ReminderText = ReminderText, UserId = UserId }; return(data); }
public UserData ToUserData() { UserData data = new UserData(Id) { Surname = Surname, Name = Name, Login = Login, PasswordHash = PasswordHash, LastLogin = UnixEpoch.Add(TimeSpan.FromSeconds(LastLogin)), Notifications = new List <ReminderData>(), Email = Email }; foreach (var notification in Notifications) { data.Notifications.Add(notification.ToReminderData()); } return(data); }