Class: SC.DateFieldView
Extends
SC.TextFieldView.
A Date field add behaviour to the Text Field to support date management, for example, disabling deletion, and special behaviour to tabs commands.
This field view is tightly integrated with SC.DateTime
By default the Date Field View show Date only, but if you need to show the Time do:
dateAndTime: Shared.DateFieldView.design({
showTime: YES,
valueBinding: '...'
}),
and if you only need to show time:
timeOnly: Shared.DateFieldView.design({
showTime: YES,
showDate: NO,
valueBinding: '...'
})
Example usage with special format:
specialDate: Shared.DateFieldView.design({
formatDate: '%d %b of %Y',
valueBinding: '...'
}),
You can override these format as you like, but has some limitations,
actually only support these KEY from SC.DateTime
:
%a %b %d %H %I %j %m %M %p %S %U %W %y %Y
These are keys that has FIXED length, so we can control the selection and tabing.
Defined in: date_field.js
- Since:
- SproutCore 1.0
Field Summary
- allowNumericInput
- format
- formatDate
- formatDateTime
- formatTime
- showDate
- showTime
- tabsSelections
- validator
- value
- Fields borrowed from SC.TextFieldView:
- allowsErrorAsValue, applyImmediately, autoCapitalize, autoComplete, autoCorrect, autoResizePadding, commitOnBlur, defaultTabbingEnabled, focused, formattedHint, hint, hintOnFocus, isBrowserFocusable, isContextMenuEnabled, isEditable, isEditing, isTextArea, isTextField, leftAccessoryView, localize, maxLength, rightAccessoryView, selection, shouldRenderBorder, spellCheckEnabled, supportsAutoResize, type, useHintOverlay
- Fields borrowed from SC.View:
- acceptsMultitouch, ariaHidden, ariaRole, attributeBindings, autoMixins, backgroundColor, childViewLayout, childViewLayoutOptions, childViews, childViewsNeedLayout, classNameBindings, classNames, concatenatedProperties, createdByParent, designMode, displayProperties, enabledState, firstKeyView, hasLayout, hasTouch, hasVisibility, isBuildingIn, isBuildingOut, isChildViewLayoutLive, isEnabled, isFixedHeight, isFixedPosition, isFixedSize, isFixedWidth, isKeyResponder, isTextSelectable, isView, isVisible, lastKeyView, layerLocationNeedsUpdate, layerNeedsUpdate, layout, modeAdjust, nextKeyView, page, pane, parentView, previousKeyView, renderDelegateName, shouldInheritCursor, shouldInheritEnabled, tagName, themeName, toolTip, touchBoundary, transitionAdjust, transitionAdjustOptions, transitionHide, transitionHideOptions, transitionIn, transitionInOptions, transitionOut, transitionOutOptions, transitionShow, transitionShowOptions, useStaticLayout
- Fields borrowed from SC.Responder:
- hasFirstResponder, isFirstResponder, responderContext
- Fields borrowed from SC.Object:
- isDestroyed, isObject, nextProperty, object, property, target, toInvalidate
- Fields borrowed from SC.Observable:
- isObservable
- Fields borrowed from SC.Control:
- controlSize, errorLabel, fieldKey, fieldLabel, isActive, isControl, isSelected
Field Detail
allowNumericInput BooleanSet this to NO
to disallow the default keyboard handling, which attempts to convert
numeric keystrokes into valid dates.
- Default value:
- YES
- Default value:
- '%d/%m/%Y'
- Default value:
- '%d/%m/%Y %I:%M %p'
- Default value:
- '%I:%M %p'
- Default value:
- YES
- Default value:
- NO
- Default value:
- null