yui-rails-asset 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +21 -0
- data/README +17 -0
- data/lib/yui/rails.rb +29 -0
- data/lib/yui/rails/engine.rb +10 -0
- data/lib/yui/rails/version.rb +6 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/animation/animation-debug.js +1396 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/animation/animation-min.js +23 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/animation/animation.js +1392 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/ajax-loader.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/asc.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/autocomplete.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/back-h.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/back-v.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bar-h.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bar-v.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bg-h.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bg-v.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/blankimage.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/button.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/calendar.css +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/carousel.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/check0.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/check1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/check2.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/colorpicker.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/container.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/datatable.css +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/desc.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/dt-arrow-dn.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/dt-arrow-up.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor-knob.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor-sprite-active.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor-sprite.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor.css +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/header_background.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/hue_bg.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/imagecropper.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/layout.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/layout_sprite.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/loading.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/logger.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menu-button-arrow-disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menu-button-arrow.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menu.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menubaritem_submenuindicator.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menubaritem_submenuindicator_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_checkbox.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_checkbox_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_submenuindicator.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_submenuindicator_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/paginator.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/picker_mask.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/profilerviewer.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/progressbar.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/resize.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/simpleeditor.css +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/skin.css +36 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/slider.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-active.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-focus.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-hover.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/sprite.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/sprite.psd +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/tabview.css +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/treeview-loading.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/treeview-sprite.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/treeview.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/wait.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/yuitest.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/assets/autocomplete-core.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/assets/skins/sam/autocomplete-skin.css +57 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/assets/skins/sam/autocomplete.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/autocomplete-debug.js +3009 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/autocomplete-min.js +12 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/autocomplete.js +2966 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/base/base-min.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/base/base.css +131 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/button-core.css +44 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/button-skin.css +219 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/button.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/menu-button-arrow-disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/menu-button-arrow.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-active.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-focus.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-hover.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/button-debug.js +4694 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/button-min.js +11 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/button.js +4633 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calendar-core.css +132 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calendar.css +320 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calgrad.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/callt.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calrt.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calx.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/skins/sam/calendar-skin.css +361 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/skins/sam/calendar.css +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/calendar-debug.js +7324 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/calendar-min.js +18 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/calendar.js +7294 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/ajax-loader.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/carousel-core.css +88 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/skins/sam/ajax-loader.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/skins/sam/carousel-skin.css +142 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/skins/sam/carousel.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/carousel-debug.js +4390 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/carousel-min.js +12 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/carousel.js +4349 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/charts/assets/charts.swf +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/charts/charts-debug.js +2061 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/charts/charts-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/charts/charts.js +2060 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/colorpicker-core.css +6 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/hue_thumb.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/picker_mask.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/picker_thumb.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/colorpicker-skin.css +105 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/colorpicker.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/hue_bg.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/picker_mask.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/colorpicker-debug.js +1783 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/colorpicker-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/colorpicker.js +1763 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection-debug.js +1576 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection.js +1546 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection.swf +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection_core-debug.js +980 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection_core-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection_core.js +957 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/alrt16_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/blck16_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/close12_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/container-core.css +176 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/container.css +324 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/hlp16_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/info16_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/skins/sam/container-skin.css +242 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/skins/sam/container.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/tip16_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/warn16_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/container-debug.js +9076 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/container-min.js +19 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/container.js +9052 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/container_core-debug.js +5136 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/container_core-min.js +14 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/container_core.js +5126 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/cookie/cookie-debug.js +482 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/cookie/cookie-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/cookie/cookie.js +482 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datasource/datasource-debug.js +3067 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datasource/datasource-min.js +12 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datasource/datasource.js +2996 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/datatable-core.css +93 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/datatable.css +49 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/datatable-skin.css +240 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/datatable.css +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/dt-arrow-dn.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/dt-arrow-up.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/datatable-debug.js +17360 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/datatable-min.js +29 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/datatable.js +17122 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datemath/datemath-debug.js +408 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datemath/datemath-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datemath/datemath.js +408 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/dom/dom-debug.js +1872 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/dom/dom-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/dom/dom.js +1832 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/dragdrop/dragdrop-debug.js +3710 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/dragdrop/dragdrop-min.js +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/dragdrop/dragdrop.js +3601 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/editor-core.css +602 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/simpleeditor-core.css +602 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/blankimage.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-knob.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-skin.css +711 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-sprite-active.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-sprite.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor.css +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/simpleeditor-skin.css +711 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/simpleeditor.css +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/editor-debug.js +9557 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/editor-min.js +30 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/editor.js +9447 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/simpleeditor-debug.js +7493 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/simpleeditor-min.js +24 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/simpleeditor.js +7406 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/element-delegate/element-delegate-debug.js +141 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/element-delegate/element-delegate-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/element-delegate/element-delegate.js +138 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/element/element-debug.js +1106 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/element/element-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/element/element.js +1090 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-delegate/event-delegate-debug.js +283 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-delegate/event-delegate-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-delegate/event-delegate.js +281 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-mouseenter/event-mouseenter-debug.js +219 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-mouseenter/event-mouseenter-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-mouseenter/event-mouseenter.js +219 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-simulate/event-simulate-debug.js +622 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-simulate/event-simulate-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-simulate/event-simulate.js +622 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event/event-debug.js +2524 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event/event-min.js +11 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event/event.js +2500 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/fonts/fonts-min.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/fonts/fonts.css +56 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/get/get-debug.js +773 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/get/get-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/get/get.js +755 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/grids/grids-min.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/grids/grids.css +467 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/history/assets/blank.html +1 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/history/history-debug.js +808 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/history/history-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/history/history.js +808 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/assets/imagecropper-core.css +33 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/assets/skins/sam/imagecropper-skin.css +16 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/assets/skins/sam/imagecropper.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/imagecropper-debug.js +907 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/imagecropper-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/imagecropper.js +889 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imageloader/imageloader-debug.js +487 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imageloader/imageloader-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imageloader/imageloader.js +481 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/json/json-debug.js +538 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/json/json-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/json/json.js +538 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/layout-core.css +158 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/skins/sam/layout-skin.css +207 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/skins/sam/layout.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/skins/sam/layout_sprite.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/layout-debug.js +2305 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/layout-min.js +11 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/layout.js +2290 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/logger-core.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/logger.css +57 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/skins/sam/logger-skin.css +55 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/skins/sam/logger.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/logger-debug.js +2104 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/logger-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/logger.js +2104 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu-core.css +242 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu.css +503 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_down_arrow.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_down_arrow_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_up_arrow.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_up_arrow_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menubaritem_submenuindicator.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menubaritem_submenuindicator_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menubaritem_submenuindicator_selected.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_checkbox.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_checkbox_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_checkbox_selected.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_submenuindicator.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_submenuindicator_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_submenuindicator_selected.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menu-skin.css +339 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menu.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menubaritem_submenuindicator.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_checkbox.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_checkbox_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_submenuindicator.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/menu-debug.js +9870 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/menu-min.js +16 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/menu.js +9823 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/paginator/assets/paginator-core.css +6 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/paginator/assets/skins/sam/paginator-skin.css +78 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/paginator/assets/skins/sam/paginator.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/paginator/paginator-debug.js +2393 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/paginator/paginator-min.js +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/paginator/paginator.js +2393 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profiler/profiler-debug.js +557 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profiler/profiler-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profiler/profiler.js +557 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/profilerviewer-core.css +6 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/asc.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/desc.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/header_background.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/profilerviewer-skin.css +167 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/profilerviewer.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/wait.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/profilerviewer-debug.js +1229 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/profilerviewer-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/profilerviewer.js +1192 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/progressbar-core.css +85 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/back-h.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/back-v.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/bar-h.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/bar-v.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/progressbar-skin.css +56 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/progressbar.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/progressbar-debug.js +691 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/progressbar-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/progressbar.js +677 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/reset-fonts-grids/reset-fonts-grids.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/reset-fonts/reset-fonts.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/reset/reset-min.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/reset/reset.css +142 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/resize-core.css +173 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/skins/sam/layout_sprite.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/skins/sam/resize-skin.css +142 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/skins/sam/resize.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/resize-debug.js +1749 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/resize-min.js +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/resize.js +1689 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/selector/selector-debug.js +651 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/selector/selector-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/selector/selector.js +644 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-fader.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-h.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-v-e.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-v.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/left-thumb.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/right-thumb.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/bg-h.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/bg-v.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/slider-skin.css +24 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/slider.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/slider-core.css +17 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/slider-skin.css +20 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-bar.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-e.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-fader.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-n.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-s.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-w.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/slider-debug.js +2114 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/slider-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/slider.js +2068 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/storage/storage-debug.js +1185 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/storage/storage-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/storage/storage.js +1183 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/stylesheet/stylesheet-debug.js +648 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/stylesheet/stylesheet-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/stylesheet/stylesheet.js +645 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swf/swf-debug.js +269 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swf/swf-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swf/swf.js +268 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfdetect/swfdetect-debug.js +93 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfdetect/swfdetect-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfdetect/swfdetect.js +93 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swf.js +238 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore-debug.js +470 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore.js +453 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore.swf +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/border_tabs.css +54 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/loading.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/skin-sam.css +77 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/skins/sam/tabview-skin.css +186 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/skins/sam/tabview.css +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/tabview-core.css +133 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/tabview.css +77 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/tabview-debug.js +995 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/tabview-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/tabview.js +987 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/check0.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/check1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/check2.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/loading.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview-loading.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview-skin.css +249 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview-sprite.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/treeview-core.css +6 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/treeview-debug.js +4058 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/treeview-min.js +12 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/treeview.js +3989 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/uploader/assets/uploader.swf +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/uploader/uploader-debug.js +1072 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/uploader/uploader-min.js +15 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/uploader/uploader.js +1069 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/utilities/utilities.js +39 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yahoo-dom-event/yahoo-dom-event.js +14 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yahoo/yahoo-debug.js +1075 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yahoo/yahoo-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yahoo/yahoo.js +1075 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader-dom-event/yuiloader-dom-event.js +17 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader/yuiloader-debug.js +3879 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader/yuiloader-min.js +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader/yuiloader.js +3879 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/skins/sam/yuitest-skin.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/skins/sam/yuitest.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/testlogger.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/yuitest-core.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest-debug.js +2741 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest-min.js +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest.js +2741 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest_core-debug.js +1976 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest_core-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest_core.js +1976 -0
- metadata +470 -0
@@ -0,0 +1,408 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
3
|
+
Code licensed under the BSD License:
|
4
|
+
http://developer.yahoo.com/yui/license.html
|
5
|
+
version: 2.8.1
|
6
|
+
*/
|
7
|
+
/**
|
8
|
+
* The datemath module provides utility methods for basic JavaScript Date object manipulation and
|
9
|
+
* comparison.
|
10
|
+
*
|
11
|
+
* @module datemath
|
12
|
+
*/
|
13
|
+
|
14
|
+
/**
|
15
|
+
* YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility
|
16
|
+
* used for adding, subtracting, and comparing dates.
|
17
|
+
* @namespace YAHOO.widget
|
18
|
+
* @class DateMath
|
19
|
+
*/
|
20
|
+
YAHOO.widget.DateMath = {
|
21
|
+
/**
|
22
|
+
* Constant field representing Day
|
23
|
+
* @property DAY
|
24
|
+
* @static
|
25
|
+
* @final
|
26
|
+
* @type String
|
27
|
+
*/
|
28
|
+
DAY : "D",
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Constant field representing Week
|
32
|
+
* @property WEEK
|
33
|
+
* @static
|
34
|
+
* @final
|
35
|
+
* @type String
|
36
|
+
*/
|
37
|
+
WEEK : "W",
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Constant field representing Year
|
41
|
+
* @property YEAR
|
42
|
+
* @static
|
43
|
+
* @final
|
44
|
+
* @type String
|
45
|
+
*/
|
46
|
+
YEAR : "Y",
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Constant field representing Month
|
50
|
+
* @property MONTH
|
51
|
+
* @static
|
52
|
+
* @final
|
53
|
+
* @type String
|
54
|
+
*/
|
55
|
+
MONTH : "M",
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Constant field representing one day, in milliseconds
|
59
|
+
* @property ONE_DAY_MS
|
60
|
+
* @static
|
61
|
+
* @final
|
62
|
+
* @type Number
|
63
|
+
*/
|
64
|
+
ONE_DAY_MS : 1000*60*60*24,
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Constant field representing the date in first week of January
|
68
|
+
* which identifies the first week of the year.
|
69
|
+
* <p>
|
70
|
+
* In the U.S, Jan 1st is normally used based on a Sunday start of week.
|
71
|
+
* ISO 8601, used widely throughout Europe, uses Jan 4th, based on a Monday start of week.
|
72
|
+
* </p>
|
73
|
+
* @property WEEK_ONE_JAN_DATE
|
74
|
+
* @static
|
75
|
+
* @type Number
|
76
|
+
*/
|
77
|
+
WEEK_ONE_JAN_DATE : 1,
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Adds the specified amount of time to the this instance.
|
81
|
+
* @method add
|
82
|
+
* @param {Date} date The JavaScript Date object to perform addition on
|
83
|
+
* @param {String} field The field constant to be used for performing addition.
|
84
|
+
* @param {Number} amount The number of units (measured in the field constant) to add to the date.
|
85
|
+
* @return {Date} The resulting Date object
|
86
|
+
*/
|
87
|
+
add : function(date, field, amount) {
|
88
|
+
var d = new Date(date.getTime());
|
89
|
+
switch (field) {
|
90
|
+
case this.MONTH:
|
91
|
+
var newMonth = date.getMonth() + amount;
|
92
|
+
var years = 0;
|
93
|
+
|
94
|
+
if (newMonth < 0) {
|
95
|
+
while (newMonth < 0) {
|
96
|
+
newMonth += 12;
|
97
|
+
years -= 1;
|
98
|
+
}
|
99
|
+
} else if (newMonth > 11) {
|
100
|
+
while (newMonth > 11) {
|
101
|
+
newMonth -= 12;
|
102
|
+
years += 1;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
d.setMonth(newMonth);
|
107
|
+
d.setFullYear(date.getFullYear() + years);
|
108
|
+
break;
|
109
|
+
case this.DAY:
|
110
|
+
this._addDays(d, amount);
|
111
|
+
// d.setDate(date.getDate() + amount);
|
112
|
+
break;
|
113
|
+
case this.YEAR:
|
114
|
+
d.setFullYear(date.getFullYear() + amount);
|
115
|
+
break;
|
116
|
+
case this.WEEK:
|
117
|
+
this._addDays(d, (amount * 7));
|
118
|
+
// d.setDate(date.getDate() + (amount * 7));
|
119
|
+
break;
|
120
|
+
}
|
121
|
+
return d;
|
122
|
+
},
|
123
|
+
|
124
|
+
/**
|
125
|
+
* Private helper method to account for bug in Safari 2 (webkit < 420)
|
126
|
+
* when Date.setDate(n) is called with n less than -128 or greater than 127.
|
127
|
+
* <p>
|
128
|
+
* Fix approach and original findings are available here:
|
129
|
+
* http://brianary.blogspot.com/2006/03/safari-date-bug.html
|
130
|
+
* </p>
|
131
|
+
* @method _addDays
|
132
|
+
* @param {Date} d JavaScript date object
|
133
|
+
* @param {Number} nDays The number of days to add to the date object (can be negative)
|
134
|
+
* @private
|
135
|
+
*/
|
136
|
+
_addDays : function(d, nDays) {
|
137
|
+
if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420) {
|
138
|
+
if (nDays < 0) {
|
139
|
+
// Ensure we don't go below -128 (getDate() is always 1 to 31, so we won't go above 127)
|
140
|
+
for(var min = -128; nDays < min; nDays -= min) {
|
141
|
+
d.setDate(d.getDate() + min);
|
142
|
+
}
|
143
|
+
} else {
|
144
|
+
// Ensure we don't go above 96 + 31 = 127
|
145
|
+
for(var max = 96; nDays > max; nDays -= max) {
|
146
|
+
d.setDate(d.getDate() + max);
|
147
|
+
}
|
148
|
+
}
|
149
|
+
// nDays should be remainder between -128 and 96
|
150
|
+
}
|
151
|
+
d.setDate(d.getDate() + nDays);
|
152
|
+
},
|
153
|
+
|
154
|
+
/**
|
155
|
+
* Subtracts the specified amount of time from the this instance.
|
156
|
+
* @method subtract
|
157
|
+
* @param {Date} date The JavaScript Date object to perform subtraction on
|
158
|
+
* @param {Number} field The this field constant to be used for performing subtraction.
|
159
|
+
* @param {Number} amount The number of units (measured in the field constant) to subtract from the date.
|
160
|
+
* @return {Date} The resulting Date object
|
161
|
+
*/
|
162
|
+
subtract : function(date, field, amount) {
|
163
|
+
return this.add(date, field, (amount*-1));
|
164
|
+
},
|
165
|
+
|
166
|
+
/**
|
167
|
+
* Determines whether a given date is before another date on the calendar.
|
168
|
+
* @method before
|
169
|
+
* @param {Date} date The Date object to compare with the compare argument
|
170
|
+
* @param {Date} compareTo The Date object to use for the comparison
|
171
|
+
* @return {Boolean} true if the date occurs before the compared date; false if not.
|
172
|
+
*/
|
173
|
+
before : function(date, compareTo) {
|
174
|
+
var ms = compareTo.getTime();
|
175
|
+
if (date.getTime() < ms) {
|
176
|
+
return true;
|
177
|
+
} else {
|
178
|
+
return false;
|
179
|
+
}
|
180
|
+
},
|
181
|
+
|
182
|
+
/**
|
183
|
+
* Determines whether a given date is after another date on the calendar.
|
184
|
+
* @method after
|
185
|
+
* @param {Date} date The Date object to compare with the compare argument
|
186
|
+
* @param {Date} compareTo The Date object to use for the comparison
|
187
|
+
* @return {Boolean} true if the date occurs after the compared date; false if not.
|
188
|
+
*/
|
189
|
+
after : function(date, compareTo) {
|
190
|
+
var ms = compareTo.getTime();
|
191
|
+
if (date.getTime() > ms) {
|
192
|
+
return true;
|
193
|
+
} else {
|
194
|
+
return false;
|
195
|
+
}
|
196
|
+
},
|
197
|
+
|
198
|
+
/**
|
199
|
+
* Determines whether a given date is between two other dates on the calendar.
|
200
|
+
* @method between
|
201
|
+
* @param {Date} date The date to check for
|
202
|
+
* @param {Date} dateBegin The start of the range
|
203
|
+
* @param {Date} dateEnd The end of the range
|
204
|
+
* @return {Boolean} true if the date occurs between the compared dates; false if not.
|
205
|
+
*/
|
206
|
+
between : function(date, dateBegin, dateEnd) {
|
207
|
+
if (this.after(date, dateBegin) && this.before(date, dateEnd)) {
|
208
|
+
return true;
|
209
|
+
} else {
|
210
|
+
return false;
|
211
|
+
}
|
212
|
+
},
|
213
|
+
|
214
|
+
/**
|
215
|
+
* Retrieves a JavaScript Date object representing January 1 of any given year.
|
216
|
+
* @method getJan1
|
217
|
+
* @param {Number} calendarYear The calendar year for which to retrieve January 1
|
218
|
+
* @return {Date} January 1 of the calendar year specified.
|
219
|
+
*/
|
220
|
+
getJan1 : function(calendarYear) {
|
221
|
+
return this.getDate(calendarYear,0,1);
|
222
|
+
},
|
223
|
+
|
224
|
+
/**
|
225
|
+
* Calculates the number of days the specified date is from January 1 of the specified calendar year.
|
226
|
+
* Passing January 1 to this function would return an offset value of zero.
|
227
|
+
* @method getDayOffset
|
228
|
+
* @param {Date} date The JavaScript date for which to find the offset
|
229
|
+
* @param {Number} calendarYear The calendar year to use for determining the offset
|
230
|
+
* @return {Number} The number of days since January 1 of the given year
|
231
|
+
*/
|
232
|
+
getDayOffset : function(date, calendarYear) {
|
233
|
+
var beginYear = this.getJan1(calendarYear); // Find the start of the year. This will be in week 1.
|
234
|
+
|
235
|
+
// Find the number of days the passed in date is away from the calendar year start
|
236
|
+
var dayOffset = Math.ceil((date.getTime()-beginYear.getTime()) / this.ONE_DAY_MS);
|
237
|
+
return dayOffset;
|
238
|
+
},
|
239
|
+
|
240
|
+
/**
|
241
|
+
* Calculates the week number for the given date. Can currently support standard
|
242
|
+
* U.S. week numbers, based on Jan 1st defining the 1st week of the year, and
|
243
|
+
* ISO8601 week numbers, based on Jan 4th defining the 1st week of the year.
|
244
|
+
*
|
245
|
+
* @method getWeekNumber
|
246
|
+
* @param {Date} date The JavaScript date for which to find the week number
|
247
|
+
* @param {Number} firstDayOfWeek The index of the first day of the week (0 = Sun, 1 = Mon ... 6 = Sat).
|
248
|
+
* Defaults to 0
|
249
|
+
* @param {Number} janDate The date in the first week of January which defines week one for the year
|
250
|
+
* Defaults to the value of YAHOO.widget.DateMath.WEEK_ONE_JAN_DATE, which is 1 (Jan 1st).
|
251
|
+
* For the U.S, this is normally Jan 1st. ISO8601 uses Jan 4th to define the first week of the year.
|
252
|
+
*
|
253
|
+
* @return {Number} The number of the week containing the given date.
|
254
|
+
*/
|
255
|
+
getWeekNumber : function(date, firstDayOfWeek, janDate) {
|
256
|
+
|
257
|
+
// Setup Defaults
|
258
|
+
firstDayOfWeek = firstDayOfWeek || 0;
|
259
|
+
janDate = janDate || this.WEEK_ONE_JAN_DATE;
|
260
|
+
|
261
|
+
var targetDate = this.clearTime(date),
|
262
|
+
startOfWeek,
|
263
|
+
endOfWeek;
|
264
|
+
|
265
|
+
if (targetDate.getDay() === firstDayOfWeek) {
|
266
|
+
startOfWeek = targetDate;
|
267
|
+
} else {
|
268
|
+
startOfWeek = this.getFirstDayOfWeek(targetDate, firstDayOfWeek);
|
269
|
+
}
|
270
|
+
|
271
|
+
var startYear = startOfWeek.getFullYear();
|
272
|
+
|
273
|
+
// DST shouldn't be a problem here, math is quicker than setDate();
|
274
|
+
endOfWeek = new Date(startOfWeek.getTime() + 6*this.ONE_DAY_MS);
|
275
|
+
|
276
|
+
var weekNum;
|
277
|
+
if (startYear !== endOfWeek.getFullYear() && endOfWeek.getDate() >= janDate) {
|
278
|
+
// If years don't match, endOfWeek is in Jan. and if the
|
279
|
+
// week has WEEK_ONE_JAN_DATE in it, it's week one by definition.
|
280
|
+
weekNum = 1;
|
281
|
+
} else {
|
282
|
+
// Get the 1st day of the 1st week, and
|
283
|
+
// find how many days away we are from it.
|
284
|
+
var weekOne = this.clearTime(this.getDate(startYear, 0, janDate)),
|
285
|
+
weekOneDayOne = this.getFirstDayOfWeek(weekOne, firstDayOfWeek);
|
286
|
+
|
287
|
+
// Round days to smoothen out 1 hr DST diff
|
288
|
+
var daysDiff = Math.round((targetDate.getTime() - weekOneDayOne.getTime())/this.ONE_DAY_MS);
|
289
|
+
|
290
|
+
// Calc. Full Weeks
|
291
|
+
var rem = daysDiff % 7;
|
292
|
+
var weeksDiff = (daysDiff - rem)/7;
|
293
|
+
weekNum = weeksDiff + 1;
|
294
|
+
}
|
295
|
+
return weekNum;
|
296
|
+
},
|
297
|
+
|
298
|
+
/**
|
299
|
+
* Get the first day of the week, for the give date.
|
300
|
+
* @param {Date} dt The date in the week for which the first day is required.
|
301
|
+
* @param {Number} startOfWeek The index for the first day of the week, 0 = Sun, 1 = Mon ... 6 = Sat (defaults to 0)
|
302
|
+
* @return {Date} The first day of the week
|
303
|
+
*/
|
304
|
+
getFirstDayOfWeek : function (dt, startOfWeek) {
|
305
|
+
startOfWeek = startOfWeek || 0;
|
306
|
+
var dayOfWeekIndex = dt.getDay(),
|
307
|
+
dayOfWeek = (dayOfWeekIndex - startOfWeek + 7) % 7;
|
308
|
+
|
309
|
+
return this.subtract(dt, this.DAY, dayOfWeek);
|
310
|
+
},
|
311
|
+
|
312
|
+
/**
|
313
|
+
* Determines if a given week overlaps two different years.
|
314
|
+
* @method isYearOverlapWeek
|
315
|
+
* @param {Date} weekBeginDate The JavaScript Date representing the first day of the week.
|
316
|
+
* @return {Boolean} true if the date overlaps two different years.
|
317
|
+
*/
|
318
|
+
isYearOverlapWeek : function(weekBeginDate) {
|
319
|
+
var overlaps = false;
|
320
|
+
var nextWeek = this.add(weekBeginDate, this.DAY, 6);
|
321
|
+
if (nextWeek.getFullYear() != weekBeginDate.getFullYear()) {
|
322
|
+
overlaps = true;
|
323
|
+
}
|
324
|
+
return overlaps;
|
325
|
+
},
|
326
|
+
|
327
|
+
/**
|
328
|
+
* Determines if a given week overlaps two different months.
|
329
|
+
* @method isMonthOverlapWeek
|
330
|
+
* @param {Date} weekBeginDate The JavaScript Date representing the first day of the week.
|
331
|
+
* @return {Boolean} true if the date overlaps two different months.
|
332
|
+
*/
|
333
|
+
isMonthOverlapWeek : function(weekBeginDate) {
|
334
|
+
var overlaps = false;
|
335
|
+
var nextWeek = this.add(weekBeginDate, this.DAY, 6);
|
336
|
+
if (nextWeek.getMonth() != weekBeginDate.getMonth()) {
|
337
|
+
overlaps = true;
|
338
|
+
}
|
339
|
+
return overlaps;
|
340
|
+
},
|
341
|
+
|
342
|
+
/**
|
343
|
+
* Gets the first day of a month containing a given date.
|
344
|
+
* @method findMonthStart
|
345
|
+
* @param {Date} date The JavaScript Date used to calculate the month start
|
346
|
+
* @return {Date} The JavaScript Date representing the first day of the month
|
347
|
+
*/
|
348
|
+
findMonthStart : function(date) {
|
349
|
+
var start = this.getDate(date.getFullYear(), date.getMonth(), 1);
|
350
|
+
return start;
|
351
|
+
},
|
352
|
+
|
353
|
+
/**
|
354
|
+
* Gets the last day of a month containing a given date.
|
355
|
+
* @method findMonthEnd
|
356
|
+
* @param {Date} date The JavaScript Date used to calculate the month end
|
357
|
+
* @return {Date} The JavaScript Date representing the last day of the month
|
358
|
+
*/
|
359
|
+
findMonthEnd : function(date) {
|
360
|
+
var start = this.findMonthStart(date);
|
361
|
+
var nextMonth = this.add(start, this.MONTH, 1);
|
362
|
+
var end = this.subtract(nextMonth, this.DAY, 1);
|
363
|
+
return end;
|
364
|
+
},
|
365
|
+
|
366
|
+
/**
|
367
|
+
* Clears the time fields from a given date, effectively setting the time to 12 noon.
|
368
|
+
* @method clearTime
|
369
|
+
* @param {Date} date The JavaScript Date for which the time fields will be cleared
|
370
|
+
* @return {Date} The JavaScript Date cleared of all time fields
|
371
|
+
*/
|
372
|
+
clearTime : function(date) {
|
373
|
+
date.setHours(12,0,0,0);
|
374
|
+
return date;
|
375
|
+
},
|
376
|
+
|
377
|
+
/**
|
378
|
+
* Returns a new JavaScript Date object, representing the given year, month and date. Time fields (hr, min, sec, ms) on the new Date object
|
379
|
+
* are set to 0. The method allows Date instances to be created with the a year less than 100. "new Date(year, month, date)" implementations
|
380
|
+
* set the year to 19xx if a year (xx) which is less than 100 is provided.
|
381
|
+
* <p>
|
382
|
+
* <em>NOTE:</em>Validation on argument values is not performed. It is the caller's responsibility to ensure
|
383
|
+
* arguments are valid as per the ECMAScript-262 Date object specification for the new Date(year, month[, date]) constructor.
|
384
|
+
* </p>
|
385
|
+
* @method getDate
|
386
|
+
* @param {Number} y Year.
|
387
|
+
* @param {Number} m Month index from 0 (Jan) to 11 (Dec).
|
388
|
+
* @param {Number} d (optional) Date from 1 to 31. If not provided, defaults to 1.
|
389
|
+
* @return {Date} The JavaScript date object with year, month, date set as provided.
|
390
|
+
*/
|
391
|
+
getDate : function(y, m, d) {
|
392
|
+
var dt = null;
|
393
|
+
if (YAHOO.lang.isUndefined(d)) {
|
394
|
+
d = 1;
|
395
|
+
}
|
396
|
+
if (y >= 100) {
|
397
|
+
dt = new Date(y, m, d);
|
398
|
+
} else {
|
399
|
+
dt = new Date();
|
400
|
+
dt.setFullYear(y);
|
401
|
+
dt.setMonth(m);
|
402
|
+
dt.setDate(d);
|
403
|
+
dt.setHours(0,0,0,0);
|
404
|
+
}
|
405
|
+
return dt;
|
406
|
+
}
|
407
|
+
};
|
408
|
+
YAHOO.register("datemath", YAHOO.widget.DateMath, {version: "2.8.1", build: "19"});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
3
|
+
Code licensed under the BSD License:
|
4
|
+
http://developer.yahoo.com/yui/license.html
|
5
|
+
version: 2.8.1
|
6
|
+
*/
|
7
|
+
YAHOO.widget.DateMath={DAY:"D",WEEK:"W",YEAR:"Y",MONTH:"M",ONE_DAY_MS:1000*60*60*24,WEEK_ONE_JAN_DATE:1,add:function(A,D,C){var F=new Date(A.getTime());switch(D){case this.MONTH:var E=A.getMonth()+C;var B=0;if(E<0){while(E<0){E+=12;B-=1;}}else{if(E>11){while(E>11){E-=12;B+=1;}}}F.setMonth(E);F.setFullYear(A.getFullYear()+B);break;case this.DAY:this._addDays(F,C);break;case this.YEAR:F.setFullYear(A.getFullYear()+C);break;case this.WEEK:this._addDays(F,(C*7));break;}return F;},_addDays:function(D,C){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420){if(C<0){for(var B=-128;C<B;C-=B){D.setDate(D.getDate()+B);}}else{for(var A=96;C>A;C-=A){D.setDate(D.getDate()+A);}}}D.setDate(D.getDate()+C);},subtract:function(A,C,B){return this.add(A,C,(B*-1));},before:function(C,B){var A=B.getTime();if(C.getTime()<A){return true;}else{return false;}},after:function(C,B){var A=B.getTime();if(C.getTime()>A){return true;}else{return false;}},between:function(B,A,C){if(this.after(B,A)&&this.before(B,C)){return true;}else{return false;}},getJan1:function(A){return this.getDate(A,0,1);},getDayOffset:function(B,D){var C=this.getJan1(D);var A=Math.ceil((B.getTime()-C.getTime())/this.ONE_DAY_MS);return A;},getWeekNumber:function(D,B,G){B=B||0;G=G||this.WEEK_ONE_JAN_DATE;var H=this.clearTime(D),L,M;if(H.getDay()===B){L=H;}else{L=this.getFirstDayOfWeek(H,B);}var I=L.getFullYear();M=new Date(L.getTime()+6*this.ONE_DAY_MS);var F;if(I!==M.getFullYear()&&M.getDate()>=G){F=1;}else{var E=this.clearTime(this.getDate(I,0,G)),A=this.getFirstDayOfWeek(E,B);var J=Math.round((H.getTime()-A.getTime())/this.ONE_DAY_MS);var K=J%7;var C=(J-K)/7;F=C+1;}return F;},getFirstDayOfWeek:function(D,A){A=A||0;var B=D.getDay(),C=(B-A+7)%7;return this.subtract(D,this.DAY,C);},isYearOverlapWeek:function(A){var C=false;var B=this.add(A,this.DAY,6);if(B.getFullYear()!=A.getFullYear()){C=true;}return C;},isMonthOverlapWeek:function(A){var C=false;var B=this.add(A,this.DAY,6);if(B.getMonth()!=A.getMonth()){C=true;}return C;},findMonthStart:function(A){var B=this.getDate(A.getFullYear(),A.getMonth(),1);return B;},findMonthEnd:function(B){var D=this.findMonthStart(B);var C=this.add(D,this.MONTH,1);var A=this.subtract(C,this.DAY,1);return A;},clearTime:function(A){A.setHours(12,0,0,0);return A;},getDate:function(D,A,C){var B=null;if(YAHOO.lang.isUndefined(C)){C=1;}if(D>=100){B=new Date(D,A,C);}else{B=new Date();B.setFullYear(D);B.setMonth(A);B.setDate(C);B.setHours(0,0,0,0);}return B;}};YAHOO.register("datemath",YAHOO.widget.DateMath,{version:"2.8.1",build:"19"});
|
@@ -0,0 +1,408 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
3
|
+
Code licensed under the BSD License:
|
4
|
+
http://developer.yahoo.com/yui/license.html
|
5
|
+
version: 2.8.1
|
6
|
+
*/
|
7
|
+
/**
|
8
|
+
* The datemath module provides utility methods for basic JavaScript Date object manipulation and
|
9
|
+
* comparison.
|
10
|
+
*
|
11
|
+
* @module datemath
|
12
|
+
*/
|
13
|
+
|
14
|
+
/**
|
15
|
+
* YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility
|
16
|
+
* used for adding, subtracting, and comparing dates.
|
17
|
+
* @namespace YAHOO.widget
|
18
|
+
* @class DateMath
|
19
|
+
*/
|
20
|
+
YAHOO.widget.DateMath = {
|
21
|
+
/**
|
22
|
+
* Constant field representing Day
|
23
|
+
* @property DAY
|
24
|
+
* @static
|
25
|
+
* @final
|
26
|
+
* @type String
|
27
|
+
*/
|
28
|
+
DAY : "D",
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Constant field representing Week
|
32
|
+
* @property WEEK
|
33
|
+
* @static
|
34
|
+
* @final
|
35
|
+
* @type String
|
36
|
+
*/
|
37
|
+
WEEK : "W",
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Constant field representing Year
|
41
|
+
* @property YEAR
|
42
|
+
* @static
|
43
|
+
* @final
|
44
|
+
* @type String
|
45
|
+
*/
|
46
|
+
YEAR : "Y",
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Constant field representing Month
|
50
|
+
* @property MONTH
|
51
|
+
* @static
|
52
|
+
* @final
|
53
|
+
* @type String
|
54
|
+
*/
|
55
|
+
MONTH : "M",
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Constant field representing one day, in milliseconds
|
59
|
+
* @property ONE_DAY_MS
|
60
|
+
* @static
|
61
|
+
* @final
|
62
|
+
* @type Number
|
63
|
+
*/
|
64
|
+
ONE_DAY_MS : 1000*60*60*24,
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Constant field representing the date in first week of January
|
68
|
+
* which identifies the first week of the year.
|
69
|
+
* <p>
|
70
|
+
* In the U.S, Jan 1st is normally used based on a Sunday start of week.
|
71
|
+
* ISO 8601, used widely throughout Europe, uses Jan 4th, based on a Monday start of week.
|
72
|
+
* </p>
|
73
|
+
* @property WEEK_ONE_JAN_DATE
|
74
|
+
* @static
|
75
|
+
* @type Number
|
76
|
+
*/
|
77
|
+
WEEK_ONE_JAN_DATE : 1,
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Adds the specified amount of time to the this instance.
|
81
|
+
* @method add
|
82
|
+
* @param {Date} date The JavaScript Date object to perform addition on
|
83
|
+
* @param {String} field The field constant to be used for performing addition.
|
84
|
+
* @param {Number} amount The number of units (measured in the field constant) to add to the date.
|
85
|
+
* @return {Date} The resulting Date object
|
86
|
+
*/
|
87
|
+
add : function(date, field, amount) {
|
88
|
+
var d = new Date(date.getTime());
|
89
|
+
switch (field) {
|
90
|
+
case this.MONTH:
|
91
|
+
var newMonth = date.getMonth() + amount;
|
92
|
+
var years = 0;
|
93
|
+
|
94
|
+
if (newMonth < 0) {
|
95
|
+
while (newMonth < 0) {
|
96
|
+
newMonth += 12;
|
97
|
+
years -= 1;
|
98
|
+
}
|
99
|
+
} else if (newMonth > 11) {
|
100
|
+
while (newMonth > 11) {
|
101
|
+
newMonth -= 12;
|
102
|
+
years += 1;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
d.setMonth(newMonth);
|
107
|
+
d.setFullYear(date.getFullYear() + years);
|
108
|
+
break;
|
109
|
+
case this.DAY:
|
110
|
+
this._addDays(d, amount);
|
111
|
+
// d.setDate(date.getDate() + amount);
|
112
|
+
break;
|
113
|
+
case this.YEAR:
|
114
|
+
d.setFullYear(date.getFullYear() + amount);
|
115
|
+
break;
|
116
|
+
case this.WEEK:
|
117
|
+
this._addDays(d, (amount * 7));
|
118
|
+
// d.setDate(date.getDate() + (amount * 7));
|
119
|
+
break;
|
120
|
+
}
|
121
|
+
return d;
|
122
|
+
},
|
123
|
+
|
124
|
+
/**
|
125
|
+
* Private helper method to account for bug in Safari 2 (webkit < 420)
|
126
|
+
* when Date.setDate(n) is called with n less than -128 or greater than 127.
|
127
|
+
* <p>
|
128
|
+
* Fix approach and original findings are available here:
|
129
|
+
* http://brianary.blogspot.com/2006/03/safari-date-bug.html
|
130
|
+
* </p>
|
131
|
+
* @method _addDays
|
132
|
+
* @param {Date} d JavaScript date object
|
133
|
+
* @param {Number} nDays The number of days to add to the date object (can be negative)
|
134
|
+
* @private
|
135
|
+
*/
|
136
|
+
_addDays : function(d, nDays) {
|
137
|
+
if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420) {
|
138
|
+
if (nDays < 0) {
|
139
|
+
// Ensure we don't go below -128 (getDate() is always 1 to 31, so we won't go above 127)
|
140
|
+
for(var min = -128; nDays < min; nDays -= min) {
|
141
|
+
d.setDate(d.getDate() + min);
|
142
|
+
}
|
143
|
+
} else {
|
144
|
+
// Ensure we don't go above 96 + 31 = 127
|
145
|
+
for(var max = 96; nDays > max; nDays -= max) {
|
146
|
+
d.setDate(d.getDate() + max);
|
147
|
+
}
|
148
|
+
}
|
149
|
+
// nDays should be remainder between -128 and 96
|
150
|
+
}
|
151
|
+
d.setDate(d.getDate() + nDays);
|
152
|
+
},
|
153
|
+
|
154
|
+
/**
|
155
|
+
* Subtracts the specified amount of time from the this instance.
|
156
|
+
* @method subtract
|
157
|
+
* @param {Date} date The JavaScript Date object to perform subtraction on
|
158
|
+
* @param {Number} field The this field constant to be used for performing subtraction.
|
159
|
+
* @param {Number} amount The number of units (measured in the field constant) to subtract from the date.
|
160
|
+
* @return {Date} The resulting Date object
|
161
|
+
*/
|
162
|
+
subtract : function(date, field, amount) {
|
163
|
+
return this.add(date, field, (amount*-1));
|
164
|
+
},
|
165
|
+
|
166
|
+
/**
|
167
|
+
* Determines whether a given date is before another date on the calendar.
|
168
|
+
* @method before
|
169
|
+
* @param {Date} date The Date object to compare with the compare argument
|
170
|
+
* @param {Date} compareTo The Date object to use for the comparison
|
171
|
+
* @return {Boolean} true if the date occurs before the compared date; false if not.
|
172
|
+
*/
|
173
|
+
before : function(date, compareTo) {
|
174
|
+
var ms = compareTo.getTime();
|
175
|
+
if (date.getTime() < ms) {
|
176
|
+
return true;
|
177
|
+
} else {
|
178
|
+
return false;
|
179
|
+
}
|
180
|
+
},
|
181
|
+
|
182
|
+
/**
|
183
|
+
* Determines whether a given date is after another date on the calendar.
|
184
|
+
* @method after
|
185
|
+
* @param {Date} date The Date object to compare with the compare argument
|
186
|
+
* @param {Date} compareTo The Date object to use for the comparison
|
187
|
+
* @return {Boolean} true if the date occurs after the compared date; false if not.
|
188
|
+
*/
|
189
|
+
after : function(date, compareTo) {
|
190
|
+
var ms = compareTo.getTime();
|
191
|
+
if (date.getTime() > ms) {
|
192
|
+
return true;
|
193
|
+
} else {
|
194
|
+
return false;
|
195
|
+
}
|
196
|
+
},
|
197
|
+
|
198
|
+
/**
|
199
|
+
* Determines whether a given date is between two other dates on the calendar.
|
200
|
+
* @method between
|
201
|
+
* @param {Date} date The date to check for
|
202
|
+
* @param {Date} dateBegin The start of the range
|
203
|
+
* @param {Date} dateEnd The end of the range
|
204
|
+
* @return {Boolean} true if the date occurs between the compared dates; false if not.
|
205
|
+
*/
|
206
|
+
between : function(date, dateBegin, dateEnd) {
|
207
|
+
if (this.after(date, dateBegin) && this.before(date, dateEnd)) {
|
208
|
+
return true;
|
209
|
+
} else {
|
210
|
+
return false;
|
211
|
+
}
|
212
|
+
},
|
213
|
+
|
214
|
+
/**
|
215
|
+
* Retrieves a JavaScript Date object representing January 1 of any given year.
|
216
|
+
* @method getJan1
|
217
|
+
* @param {Number} calendarYear The calendar year for which to retrieve January 1
|
218
|
+
* @return {Date} January 1 of the calendar year specified.
|
219
|
+
*/
|
220
|
+
getJan1 : function(calendarYear) {
|
221
|
+
return this.getDate(calendarYear,0,1);
|
222
|
+
},
|
223
|
+
|
224
|
+
/**
|
225
|
+
* Calculates the number of days the specified date is from January 1 of the specified calendar year.
|
226
|
+
* Passing January 1 to this function would return an offset value of zero.
|
227
|
+
* @method getDayOffset
|
228
|
+
* @param {Date} date The JavaScript date for which to find the offset
|
229
|
+
* @param {Number} calendarYear The calendar year to use for determining the offset
|
230
|
+
* @return {Number} The number of days since January 1 of the given year
|
231
|
+
*/
|
232
|
+
getDayOffset : function(date, calendarYear) {
|
233
|
+
var beginYear = this.getJan1(calendarYear); // Find the start of the year. This will be in week 1.
|
234
|
+
|
235
|
+
// Find the number of days the passed in date is away from the calendar year start
|
236
|
+
var dayOffset = Math.ceil((date.getTime()-beginYear.getTime()) / this.ONE_DAY_MS);
|
237
|
+
return dayOffset;
|
238
|
+
},
|
239
|
+
|
240
|
+
/**
|
241
|
+
* Calculates the week number for the given date. Can currently support standard
|
242
|
+
* U.S. week numbers, based on Jan 1st defining the 1st week of the year, and
|
243
|
+
* ISO8601 week numbers, based on Jan 4th defining the 1st week of the year.
|
244
|
+
*
|
245
|
+
* @method getWeekNumber
|
246
|
+
* @param {Date} date The JavaScript date for which to find the week number
|
247
|
+
* @param {Number} firstDayOfWeek The index of the first day of the week (0 = Sun, 1 = Mon ... 6 = Sat).
|
248
|
+
* Defaults to 0
|
249
|
+
* @param {Number} janDate The date in the first week of January which defines week one for the year
|
250
|
+
* Defaults to the value of YAHOO.widget.DateMath.WEEK_ONE_JAN_DATE, which is 1 (Jan 1st).
|
251
|
+
* For the U.S, this is normally Jan 1st. ISO8601 uses Jan 4th to define the first week of the year.
|
252
|
+
*
|
253
|
+
* @return {Number} The number of the week containing the given date.
|
254
|
+
*/
|
255
|
+
getWeekNumber : function(date, firstDayOfWeek, janDate) {
|
256
|
+
|
257
|
+
// Setup Defaults
|
258
|
+
firstDayOfWeek = firstDayOfWeek || 0;
|
259
|
+
janDate = janDate || this.WEEK_ONE_JAN_DATE;
|
260
|
+
|
261
|
+
var targetDate = this.clearTime(date),
|
262
|
+
startOfWeek,
|
263
|
+
endOfWeek;
|
264
|
+
|
265
|
+
if (targetDate.getDay() === firstDayOfWeek) {
|
266
|
+
startOfWeek = targetDate;
|
267
|
+
} else {
|
268
|
+
startOfWeek = this.getFirstDayOfWeek(targetDate, firstDayOfWeek);
|
269
|
+
}
|
270
|
+
|
271
|
+
var startYear = startOfWeek.getFullYear();
|
272
|
+
|
273
|
+
// DST shouldn't be a problem here, math is quicker than setDate();
|
274
|
+
endOfWeek = new Date(startOfWeek.getTime() + 6*this.ONE_DAY_MS);
|
275
|
+
|
276
|
+
var weekNum;
|
277
|
+
if (startYear !== endOfWeek.getFullYear() && endOfWeek.getDate() >= janDate) {
|
278
|
+
// If years don't match, endOfWeek is in Jan. and if the
|
279
|
+
// week has WEEK_ONE_JAN_DATE in it, it's week one by definition.
|
280
|
+
weekNum = 1;
|
281
|
+
} else {
|
282
|
+
// Get the 1st day of the 1st week, and
|
283
|
+
// find how many days away we are from it.
|
284
|
+
var weekOne = this.clearTime(this.getDate(startYear, 0, janDate)),
|
285
|
+
weekOneDayOne = this.getFirstDayOfWeek(weekOne, firstDayOfWeek);
|
286
|
+
|
287
|
+
// Round days to smoothen out 1 hr DST diff
|
288
|
+
var daysDiff = Math.round((targetDate.getTime() - weekOneDayOne.getTime())/this.ONE_DAY_MS);
|
289
|
+
|
290
|
+
// Calc. Full Weeks
|
291
|
+
var rem = daysDiff % 7;
|
292
|
+
var weeksDiff = (daysDiff - rem)/7;
|
293
|
+
weekNum = weeksDiff + 1;
|
294
|
+
}
|
295
|
+
return weekNum;
|
296
|
+
},
|
297
|
+
|
298
|
+
/**
|
299
|
+
* Get the first day of the week, for the give date.
|
300
|
+
* @param {Date} dt The date in the week for which the first day is required.
|
301
|
+
* @param {Number} startOfWeek The index for the first day of the week, 0 = Sun, 1 = Mon ... 6 = Sat (defaults to 0)
|
302
|
+
* @return {Date} The first day of the week
|
303
|
+
*/
|
304
|
+
getFirstDayOfWeek : function (dt, startOfWeek) {
|
305
|
+
startOfWeek = startOfWeek || 0;
|
306
|
+
var dayOfWeekIndex = dt.getDay(),
|
307
|
+
dayOfWeek = (dayOfWeekIndex - startOfWeek + 7) % 7;
|
308
|
+
|
309
|
+
return this.subtract(dt, this.DAY, dayOfWeek);
|
310
|
+
},
|
311
|
+
|
312
|
+
/**
|
313
|
+
* Determines if a given week overlaps two different years.
|
314
|
+
* @method isYearOverlapWeek
|
315
|
+
* @param {Date} weekBeginDate The JavaScript Date representing the first day of the week.
|
316
|
+
* @return {Boolean} true if the date overlaps two different years.
|
317
|
+
*/
|
318
|
+
isYearOverlapWeek : function(weekBeginDate) {
|
319
|
+
var overlaps = false;
|
320
|
+
var nextWeek = this.add(weekBeginDate, this.DAY, 6);
|
321
|
+
if (nextWeek.getFullYear() != weekBeginDate.getFullYear()) {
|
322
|
+
overlaps = true;
|
323
|
+
}
|
324
|
+
return overlaps;
|
325
|
+
},
|
326
|
+
|
327
|
+
/**
|
328
|
+
* Determines if a given week overlaps two different months.
|
329
|
+
* @method isMonthOverlapWeek
|
330
|
+
* @param {Date} weekBeginDate The JavaScript Date representing the first day of the week.
|
331
|
+
* @return {Boolean} true if the date overlaps two different months.
|
332
|
+
*/
|
333
|
+
isMonthOverlapWeek : function(weekBeginDate) {
|
334
|
+
var overlaps = false;
|
335
|
+
var nextWeek = this.add(weekBeginDate, this.DAY, 6);
|
336
|
+
if (nextWeek.getMonth() != weekBeginDate.getMonth()) {
|
337
|
+
overlaps = true;
|
338
|
+
}
|
339
|
+
return overlaps;
|
340
|
+
},
|
341
|
+
|
342
|
+
/**
|
343
|
+
* Gets the first day of a month containing a given date.
|
344
|
+
* @method findMonthStart
|
345
|
+
* @param {Date} date The JavaScript Date used to calculate the month start
|
346
|
+
* @return {Date} The JavaScript Date representing the first day of the month
|
347
|
+
*/
|
348
|
+
findMonthStart : function(date) {
|
349
|
+
var start = this.getDate(date.getFullYear(), date.getMonth(), 1);
|
350
|
+
return start;
|
351
|
+
},
|
352
|
+
|
353
|
+
/**
|
354
|
+
* Gets the last day of a month containing a given date.
|
355
|
+
* @method findMonthEnd
|
356
|
+
* @param {Date} date The JavaScript Date used to calculate the month end
|
357
|
+
* @return {Date} The JavaScript Date representing the last day of the month
|
358
|
+
*/
|
359
|
+
findMonthEnd : function(date) {
|
360
|
+
var start = this.findMonthStart(date);
|
361
|
+
var nextMonth = this.add(start, this.MONTH, 1);
|
362
|
+
var end = this.subtract(nextMonth, this.DAY, 1);
|
363
|
+
return end;
|
364
|
+
},
|
365
|
+
|
366
|
+
/**
|
367
|
+
* Clears the time fields from a given date, effectively setting the time to 12 noon.
|
368
|
+
* @method clearTime
|
369
|
+
* @param {Date} date The JavaScript Date for which the time fields will be cleared
|
370
|
+
* @return {Date} The JavaScript Date cleared of all time fields
|
371
|
+
*/
|
372
|
+
clearTime : function(date) {
|
373
|
+
date.setHours(12,0,0,0);
|
374
|
+
return date;
|
375
|
+
},
|
376
|
+
|
377
|
+
/**
|
378
|
+
* Returns a new JavaScript Date object, representing the given year, month and date. Time fields (hr, min, sec, ms) on the new Date object
|
379
|
+
* are set to 0. The method allows Date instances to be created with the a year less than 100. "new Date(year, month, date)" implementations
|
380
|
+
* set the year to 19xx if a year (xx) which is less than 100 is provided.
|
381
|
+
* <p>
|
382
|
+
* <em>NOTE:</em>Validation on argument values is not performed. It is the caller's responsibility to ensure
|
383
|
+
* arguments are valid as per the ECMAScript-262 Date object specification for the new Date(year, month[, date]) constructor.
|
384
|
+
* </p>
|
385
|
+
* @method getDate
|
386
|
+
* @param {Number} y Year.
|
387
|
+
* @param {Number} m Month index from 0 (Jan) to 11 (Dec).
|
388
|
+
* @param {Number} d (optional) Date from 1 to 31. If not provided, defaults to 1.
|
389
|
+
* @return {Date} The JavaScript date object with year, month, date set as provided.
|
390
|
+
*/
|
391
|
+
getDate : function(y, m, d) {
|
392
|
+
var dt = null;
|
393
|
+
if (YAHOO.lang.isUndefined(d)) {
|
394
|
+
d = 1;
|
395
|
+
}
|
396
|
+
if (y >= 100) {
|
397
|
+
dt = new Date(y, m, d);
|
398
|
+
} else {
|
399
|
+
dt = new Date();
|
400
|
+
dt.setFullYear(y);
|
401
|
+
dt.setMonth(m);
|
402
|
+
dt.setDate(d);
|
403
|
+
dt.setHours(0,0,0,0);
|
404
|
+
}
|
405
|
+
return dt;
|
406
|
+
}
|
407
|
+
};
|
408
|
+
YAHOO.register("datemath", YAHOO.widget.DateMath, {version: "2.8.1", build: "19"});
|