Home

# Class goog.ui.DatePicker

DatePicker widget. Allows a single date to be selected from a calendar like view.

extends goog.ui.Component

Instance Method Summary
| `createButton_(?Element parentNode, string label, ?Function method, string= opt_className) ⇒ ?Element` Support function for button creation.
| `createDom()` Creates the initial DOM representation for the component. The default implementation is to set this.element_ = div.
| `createMenu_(?Element srcEl, ?Array.<string> items, ?Function method, string selected)` Support function for menu creation.
| `decorateInternal(?Element element)` Actually decorates the element. Should be overridden by inheriting objects. This method can assume there are checks to ensure the component has not already been rendered have occurred and that enter document will be called afterwards. This method is considered protected.
| `destroyMenu_()` Support function for menu destruction.
| `disposeInternal()` Disposes of the component. Calls {@code exitDocument}, which is expected to remove event handlers and clean up the component. Propagates the call to the component's children, if any. Removes the component's DOM from the document unless it was decorated.
| `enterDocument()` Called when the component's element is known to be in the document. Anything using document.getElementById etc. should be done at this stage. If the component contains child components, this call is propagated to its children.
| `exitDocument()` Called by dispose to clean up the elements and listeners created by a component, or by a parent component/application who has removed the component from the document but wants to reuse it later. If the component contains child components, this call is propagated to its children. It should be possible for the component to be rendered again once this method has been called.
| `getActiveMonth() ⇒ ?goog.date.Date`
| `getAllowNone() ⇒ boolean`
| `getBaseCssClass() ⇒ string` Returns base CSS class. This getter is used to get base CSS class part. All CSS class names in component are created as: goog.getCssName(this.getBaseCssClass(), 'CLASS_NAME')
| `getDate() ⇒ ?goog.date.Date`
| `getExtraWeekAtEnd() ⇒ boolean`
| `getFirstWeekday() ⇒ number`
| `getKeyHandlerForElement_(?Element el) ⇒ ?goog.events.KeyHandler` Returns the key handler for an element and caches it so that it can be retrieved at a later point.
| `getShowFixedNumWeeks() ⇒ boolean`
| `getShowOtherMonths() ⇒ boolean`
| `getShowToday() ⇒ boolean`
| `getShowWeekNum() ⇒ boolean`
| `getShowWeekdayNames() ⇒ boolean`
| `getWeekdayClass(number wday) ⇒ string` Returns the class name associated with specified weekday.
| `handleGridClick_(?goog.events.BrowserEvent event)` Click handler for date grid.
| `handleGridKeyPress_(?goog.events.BrowserEvent event)` Keypress handler for date grid.
| `handleMenuClick_(?goog.events.BrowserEvent event)` Click handler for menu.
| `handleMenuKeyPress_(?goog.events.BrowserEvent event)` Keypress handler for menu.
| `handleMonthMenuClick_(?Element target)` Call back function for month menu.
| `handleYearMenuClick_(?Element target)` Call back function for year menu.
| `nextMonth()` Changes the active month to the next one.
| `nextYear()` Changes the active year to the next one.
| `previousMonth()` Changes the active month to the previous one.
| `previousYear()` Changes the active year to the previous one.
| `redrawCalendarGrid_()` Draws calendar view from in memory representation and applies class names depending on the selection, weekday and whatever the day belongs to the active month or not.
| `redrawWeekdays_()` Draw weekday names, if enabled. Start with whatever day has been set as the first day of week.
| `selectNone()` Clears the selection.
| `selectToday()` Selects the current date.
| `setAllowNone(boolean b)` Sets whether none is a valid selection.
| `setDate((Date|goog.date.Date|null) date)` Sets the selected date.
| `setDecorator(?Function f)` Sets the decorator function. The function should have the interface of {string} f({goog.date.Date}); and return a String representing a CSS class to decorate the cell corresponding to the date specified.
| `setExtraWeekAtEnd(boolean b)` Sets whether a the extra week(s) added always should be at the end. Only applicable if a fixed number of weeks are shown.
| `setFirstWeekday(number wday)` Sets the first day of week
| `setShowFixedNumWeeks(boolean b)` Sets whether a fixed number of weeks should be showed. If not only weeks for the current month will be showed.
| `setShowOtherMonths(boolean b)` Sets whether a days from the previous and/or next month should be shown.
| `setShowToday(boolean b)` Sets whether the today button should be shown.
| `setShowWeekNum(boolean b)` Sets whether week numbers should be shown.
| `setShowWeekdayNames(boolean b)` Sets whether weekday names should be shown.
| `setUseNarrowWeekdayNames(boolean b)` Sets whether the picker uses narrow weekday names ('M', 'T', 'W', ...). The default behavior is to use short names ('Mon', 'Tue', 'Wed', ...).
| `setUseSimpleNavigationMenu(boolean b)` Sets whether the picker should use a simple navigation menu that only contains controls for navigating to the next and previous month. The default navigation menu contains controls for navigating to the next/previous month, next/previous year, and menus for jumping to specific months and years.
| `setWeekdayClass(number wday, string className)` Sets class name associated with specified weekday.
| `showMonthMenu_(?goog.events.BrowserEvent event)` Click handler for month button. Opens month selection menu.
| `showYearMenu_(?goog.events.BrowserEvent event)` Click handler for year button. Opens year selection menu.
| `updateCalendarGrid_()` Determines the dates/weekdays for the current month and builds an in memory representation of the calendar.
| `updateFooterRow_()` Updates the footer row (with select buttons) in the footRow_ element of a created picker.
| `updateNavigationRow_()` Updates the navigation row (navigating months and maybe years) in the navRow_ element of a created picker.
| `updateTodayAndNone_()` Updates the display style of the None and Today buttons as well as hides the table foot if both are hidden.