public static void SetDisplayMonth(DateTime value, bool preserveForever = false) { _displayMonth = DateTools.GetMonth(value); if (_viewDatesSetOn != DateTime.MaxValue) { _viewDatesSetOn = preserveForever ? DateTime.MaxValue : DateTime.Now; } }
public CalendarAdapter(DateTime month, DayOfWeek firstDayOfWeek) { FirstDayOfWeek = firstDayOfWeek; month = DateTools.GetMonth(month); CenterMonth = month; FirstMonth = DateTools.GetMonth(month.AddMonths(-1000)); }
private DateTime GetCurrentDisplayMonth() { if (ContentGenerator == null) { return(DateTools.GetMonth(DateTime.Today)); } return((ContentGenerator as CalendarGenerator).GetDisplayMonth()); }
public Task EnsureLoadedForCalendarAsync(DateTime displayMonth) { displayMonth = DateTools.GetMonth(displayMonth); DateTime neededStart = displayMonth.AddMonths(-1); DateTime neededEnd = displayMonth.AddMonths(2).AddDays(-1); // Need the full next month return(EnsureLoadedAsync(neededStart, neededEnd, neededStart.AddMonths(-3), displayMonth.AddMonths(4).AddDays(-1))); }
public static DateTime GetDisplayMonth() { if (_viewDatesSetOn < DateTime.Now.AddMinutes(-5)) { _displayMonth = null; } return(_displayMonth.GetValueOrDefault(DateTools.GetMonth(DateTime.Today))); }
private DateTime?GetDateForAdd(DateTime?dueDate, bool useSelectedDate) { if (dueDate == null) { if (useSelectedDate) { dueDate = SelectedDate.Date; } else { // If we're in the current month, we'll use the default adding behavior if (DateTools.SameMonth(DisplayMonth, Today)) { dueDate = null; } else { var prevAddDate = NavigationManager.GetPreviousAddItemDate(); // If in same month we've previously added to if (prevAddDate != null && DateTools.SameMonth(DisplayMonth, prevAddDate.Value)) { // Preserve that date dueDate = prevAddDate; } // Otherwise else { // Use first day of the month dueDate = DateTools.GetMonth(DisplayMonth); } } } } return(dueDate); }
public DateTime GetDisplayMonth() { return(DateTools.GetMonth(_displayMonth)); //just in case, use the GetMonth method }
public DateTime GetMonth(int position) { return(DateTools.GetMonth(FirstMonth.AddMonths(position))); }