Esempio n. 1
0
        // Return the number of days until this note is due in the user's timezone
        public int DaysUntilDue()
        {
            DateTime dueDateLocal = DueDate.ToLocalTime(User).Date;
            DateTime todayLocal   = DateTime.UtcNow.ToLocalTime(User).Date;
            TimeSpan span         = dueDateLocal.Subtract(todayLocal);
            int      days         = (int)span.TotalDays;

            return(days < 0 ? 0 : days);
        }
Esempio n. 2
0
 // Return true if due date has passed in user's timezone
 public bool IsOverdue()
 {
     return(DueDate.ToLocalTime(User).Date < DateTime.UtcNow.ToLocalTime(User).Date);
 }
Esempio n. 3
0
 // Return true if due date is today in user's timezone
 public bool IsDue()
 {
     return(DueDate.ToLocalTime(User).Date == DateTime.UtcNow.ToLocalTime(User).Date);
 }