Lines Matching refs:Day
143 * @return {?Day|Week|Month}
152 return Day.parse(dateString);
192 function Day(year, month, date) {
213 Day.prototype = Object.create(DateType.prototype);
215 Day.ISOStringRegExp = /^(\d+)-(\d+)-(\d+)/;
219 * @return {?Day}
221 Day.parse = function(str) {
222 var match = Day.ISOStringRegExp.exec(str);
228 return new Day(year, month, date);
233 * @return {!Day}
235 Day.createFromValue = function(millisecondsSinceEpoch) {
236 return Day.createFromDate(new Date(millisecondsSinceEpoch))
241 * @return {!Day}
243 Day.createFromDate = function(date) {
246 return new Day(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
250 * @param {!Day} day
251 * @return {!Day}
253 Day.createFromDay = function(day) {
254 return day;
258 * @return {!Day}
260 Day.createFromToday = function() {
262 return new Day(now.getFullYear(), now.getMonth(), now.getDate());
269 Day.prototype.equals = function(other) {
270 return other instanceof Day && this.year === other.year && this.month === other.month && this.date === other.date;
275 * @return {!Day}
277 Day.prototype.previous = function(offset) {
280 return new Day(this.year, this.month, this.date - offset);
285 * @return {!Day}
287 Day.prototype.next = function(offset) {
290 return new Day(this.year, this.month, this.date + offset);
296 Day.prototype.startDate = function() {
303 Day.prototype.endDate = function() {
308 * @return {!Day}
310 Day.prototype.firstDay = function() {
315 * @return {!Day}
317 Day.prototype.middleDay = function() {
322 * @return {!Day}
324 Day.prototype.lastDay = function() {
331 Day.prototype.valueOf = function() {
338 Day.prototype.weekDay = function() {
345 Day.prototype.toString = function() {
353 Day.Minimum = Day.createFromValue(-62135596800000.0);
354 Day.Maximum = Day.createFromValue(8640000000000000.0);
357 Day.DefaultStep = 86400000;
358 Day.DefaultStepBase = 0;
435 * @param {!Day} day
438 Week.createFromDay = function(day) {
439 var year = day.year;
440 if (year <= Week.Maximum.year && Week.weekOneStartDayForYear(year + 1) <= day)
442 else if (year > 1 && Week.weekOneStartDayForYear(year) > day)
444 var week = Math.floor(1 + (day.valueOf() - Week.weekOneStartDayForYear(year).valueOf()) / MillisecondsPerWeek);
470 * @return {!Day}
474 return Day.Minimum;
477 return new Day(year, 0, 4 - (yearStartDay + 6) % DaysPerWeek);
543 return Day.Maximum.startDate();
548 * @return {!Day}
556 * @return {!Day}
563 * @return {!Day}
567 return Day.Maximum;
649 * @param {!Day} day
652 Month.createFromDay = function(day) {
653 return new Month(day.year, day.month);
667 Month.prototype.containsDay = function(day) {
668 return this.year === day.year && this.month === day.month;
711 return Day.Maximum.startDate();
716 * @return {!Day}
719 return new Day(this.year, this.month, 1);
723 * @return {!Day}
726 return new Day(this.year, this.month, this.month === 2 ? 14 : 15);
730 * @return {!Day}
734 return Day.Maximum;
3004 this.calendarPicker.selectRangeContainingDay(Day.createFromToday());
3030 * @type {?Day}
3032 this.day = null;
3040 DayCell.ClassNameDayCell = "day-cell";
3065 this.day = null;
3109 * @param {!Day} day
3111 DayCell.prototype.reset = function(day) {
3112 this.day = day;
3113 this.element.textContent = localizeNumber(this.day.date.toString());
3205 var labelElement = createElement("div", "week-day-label", global.params.dayLabels[weekDayNumber]);
3273 var day = calendarTableView.dayAtColumnAndRow(0, row);
3275 var dayCell = this.calendarTableView.prepareNewDayCell(day);
3278 day = day.next();
3386 this.calendarPicker.selectRangeContainingDay(dayCell.day);
3406 this.calendarPicker.highlightRangeContainingDay(dayCell.day);
3458 * @return {!Day}
3462 return Day.createFromValue(daysSinceMinimum * MillisecondsPerDay + CalendarTableView._MinimumDayValue);
3465 CalendarTableView._MinimumDayValue = Day.Minimum.valueOf();
3466 CalendarTableView._MinimumDayWeekDay = Day.Minimum.weekDay();
3469 * @param {!Day} day
3472 CalendarTableView.prototype.columnAndRowForDay = function(day) {
3473 var daysSinceMinimum = (day.valueOf() - CalendarTableView._MinimumDayValue) / MillisecondsPerDay;
3511 var day = dayCell.day;
3512 dayCell.setIsToday(Day.createFromToday().equals(day));
3513 dayCell.setSelected(day >= firstDayInSelection && day <= lastDayInSelection);
3514 dayCell.setHighlighted(day >= firstDayInHighlight && day <= lastDayInHighlight);
3515 dayCell.setIsInCurrentMonth(day >= firstDayInCurrentMonth && day <= lastDayInCurrentMonth);
3516 dayCell.setDisabled(!this.calendarPicker.isValidDay(day));
3530 * @param {!Day} day
3533 CalendarTableView.prototype.prepareNewDayCell = function(day) {
3535 dayCell.reset(day);
3536 this._dayCells[dayCell.day.toString()] = dayCell;
3555 delete this._dayCells[dayCell.day.toString()];
3586 this._dateTypeConstructor = Day;
3784 * @return {!Day}
3790 firstVisibleDay = Day.Minimum;
3795 * @return {!Day}
3801 lastVisibleDay = Day.Maximum;
3806 * @param {?Day} day
3808 CalendarPicker.prototype.selectRangeContainingDay = function(day) {
3809 var selection = day ? this._dateTypeConstructor.createFromDay(day) : null;
3814 * @param {?Day} day
3816 CalendarPicker.prototype.highlightRangeContainingDay = function(day) {
3817 var highlight = day ? this._dateTypeConstructor.createFromDay(day) : null;
3917 * @param {!Day} day
3920 CalendarPicker.prototype.isValidDay = function(day) {
3921 return this.isValid(this._dateTypeConstructor.createFromDay(day));
3946 this.selectRangeContainingDay(Day.createFromToday());