Ejemplo 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);
        }
Ejemplo 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);
 }
Ejemplo 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);
 }