├── .editorconfig ├── .gitattributes ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── dist ├── assets │ ├── css │ │ ├── demo.css │ │ └── reset.css │ ├── images │ │ ├── arrow-down.png │ │ ├── arrow-up.png │ │ ├── datepicker-date-range.png │ │ ├── datepicker-date.png │ │ ├── datepicker-datetime-range.png │ │ ├── datepicker-datetime.png │ │ ├── datepicker-month.png │ │ ├── datepicker-year.png │ │ ├── double-arrow-left.png │ │ ├── double-arrow-right.png │ │ ├── favicon.ico │ │ ├── gemini-dark.png │ │ ├── gemini.png │ │ ├── github-dark.png │ │ ├── github-gemini.png │ │ ├── github-white.png │ │ ├── left.png │ │ └── right.png │ └── js │ │ ├── demo.js │ │ ├── handlebars-v4.0.5.js │ │ ├── jquery.2.0.0.min.js │ │ ├── jquery.js │ │ └── jquery.min.js ├── css │ ├── jquery.datepicker.css │ └── jquery.datepicker.min.css ├── examples │ └── index.html ├── i18n │ ├── datepicker.en-US.js │ ├── datepicker.ru-RU.js │ ├── datepicker.vi.js │ └── datepicker.zh-CN.js └── js │ ├── jquery.datepicker.js │ └── jquery.datepicker.min.js ├── gulpfile.js ├── package.json └── src ├── assets ├── css │ ├── demo.css │ └── reset.css ├── images │ ├── arrow-down.png │ ├── arrow-up.png │ ├── datepicker-date-range.png │ ├── datepicker-date.png │ ├── datepicker-datetime-range.png │ ├── datepicker-datetime.png │ ├── datepicker-month.png │ ├── datepicker-year.png │ ├── double-arrow-left.png │ ├── double-arrow-right.png │ ├── favicon.ico │ ├── gemini-dark.png │ ├── gemini.png │ ├── github-dark.png │ ├── github-gemini.png │ ├── github-white.png │ ├── left.png │ └── right.png └── js │ ├── demo.js │ ├── handlebars-v4.0.5.js │ ├── jquery.2.0.0.min.js │ ├── jquery.js │ └── jquery.min.js ├── examples └── index.html ├── i18n ├── datepicker.en-US.js ├── datepicker.ru-RU.js ├── datepicker.vi.js └── datepicker.zh-CN.js ├── js └── jquery-datepicker.js └── sass ├── datepicker-date.scss ├── datepicker-range.scss ├── datepicker-table.scss └── timepicker.scss /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Automatically normalize line endings for all text-based files 2 | # http://git-scm.com/docs/gitattributes#_end_of_line_conversion 3 | * text=auto 4 | 5 | # For the following file types, normalize line endings to LF on 6 | # checkin and prevent conversion to CRLF when they are checked out 7 | # (this is required in order to prevent newline related issues like, 8 | # for example, after the build script is run) 9 | .* text eol=lf 10 | *.css text eol=lf 11 | *.html text eol=lf 12 | *.js text eol=lf 13 | *.json text eol=lf 14 | *.md text eol=lf 15 | *.sh text eol=lf 16 | *.txt text eol=lf 17 | *.xml text eol=lf 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Project 2 | .idea 3 | node_modules 4 | bower_components 5 | dist/*.map 6 | /_* 7 | 8 | # Windows image file caches 9 | Thumbs.db 10 | ehthumbs.db 11 | 12 | # Folder config file 13 | Desktop.ini 14 | 15 | # Recycle Bin used on file shares 16 | $RECYCLE.BIN/ 17 | 18 | # Windows Installer files 19 | *.cab 20 | *.msi 21 | *.msm 22 | *.msp 23 | 24 | # Windows shortcuts 25 | *.lnk 26 | 27 | # ========================= 28 | # Operating System Files 29 | # ========================= 30 | 31 | # OSX 32 | # ========================= 33 | 34 | .DS_Store 35 | .AppleDouble 36 | .LSOverride 37 | 38 | # Thumbnails 39 | ._* 40 | 41 | # Files that might appear on external disk 42 | .Spotlight-V100 43 | .Trashes 44 | 45 | # Directories potentially created on remote AFP share 46 | .AppleDB 47 | .AppleDesktop 48 | Network Trash Folder 49 | Temporary Items 50 | .apdisk 51 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Files to ignore 2 | 3 | bower_components 4 | examples 5 | src/assets/js 6 | src/assets/css 7 | dist/assets/js 8 | dist/assets/css 9 | /_* 10 | /.* 11 | bower.json 12 | gulpfile.js 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2015-2017 gregzhang616 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## ![Date Image](./dist/assets/images/github-gemini.png) Gemini DatePicker 2 | > A full-featured datepicker jquery plugin. 3 | 4 | ### Features 5 | + Supports more configurable options. 6 | + Supports more methods 7 | + Supports more events 8 | + Supports datetime mode 9 | + Supports range date and range datetime mode 10 | + Supports internationalization 11 | + Cross-browser support 12 | 13 | ### Example image 14 | ##### Type: date 15 | ![Date Image](./dist/assets/images/datepicker-date.png) 16 | ##### Type: month 17 | ![Year Image](./dist/assets/images/datepicker-month.png) 18 | ##### Type: year 19 | ![Month Image](./dist/assets/images/datepicker-year.png) 20 | ##### Type: datetime 21 | ![Datetime Image](./dist/assets/images/datepicker-datetime.png) 22 | ##### Type: date-range 23 | ![Date range Image](./dist/assets/images/datepicker-date-range.png) 24 | ##### Type: datetime-range 25 | ![Datetime range Image](./dist/assets/images/datepicker-datetime-range.png) 26 | 27 | ### Getting started 28 | #### Quick start 29 | + Clone the repository: git clone https://github.com/gregzhang616/jquery-datepicker.git. 30 | + Install with Npm: npm install gemini-datepicker. 31 | + Install with Bower: bower install gemini-datepicker. 32 | 33 | #### Installation 34 | ##### Include files: 35 | Css file 36 | ``` 37 | 38 | 39 | ``` 40 | Javascript file 41 | ``` 42 | 43 | 44 | // there is no need to import the next line of code when current language is 'en-US' 45 | 46 | ``` 47 | 48 | ##### CommonJs / NodeJs: 49 | Css file 50 | ``` 51 | require('gemini-datepicker/dist/css/jquery.datepicker.min.css'); 52 | ``` 53 | 54 | Javascript file 55 | ``` 56 | require('gemini-datepicker'); 57 | ``` 58 | 59 | 60 | ### Attributes 61 | >You may set datepicker options with $().datepicker(options), the options type is Object. 62 | 63 | | Name | Type | Default value | Optional value | Description | 64 | | :--- | :--- | :--- | :--- | :--- | 65 | | type | String | 'date' | year/month/date/datetime/datetime-range/date-range | type of the picker | 66 | | readonly | Boolean | false | false/ true | whether DatePicker is read only | 67 | | disabled | Boolean | false | false/ true | whether DatePicker is disabled | 68 | | format | String | 'yyyy-MM-dd' | year->yyyy, month->MM, day->dd, hour->HH, minute->mm, second->ss | format of the picker | 69 | | placeholder | String | 'Please pick a day' | -- | init input element's placeholder | 70 | | align | String | 'left' | 'left'/'center'/'right' | the pick panel's alignment | 71 | | weekStart | Number | 0 | -- | Start of the week | 72 | | startDate | Date | null | -- | If the start date exists, the date before the start date is disabled | 73 | | endDate | Date | null | -- | If the end date exists, the date after the end date is disabled | 74 | | lang | String | 'en-US' | 'en-US'/'zh-CN'/'vi' | language of the datepicker | 75 | | rangeSeparator | String | '-' | -- | if type is 'date-range' or 'datetime-range', use rangeSeparator to separate the date | 76 | | defaultValue | String/Date | '' | -- | default date, if picker type is date-range or datetime-range, picker's type must be String | 77 | | zIndex | Number | 2008 | -- | The CSS style z-index for the picker. | 78 | 79 | ### Methods 80 | > Common usage 81 | 82 | ``` 83 | $().datepicker(methodName, argument1, argument2, ..., argumentN); 84 | ``` 85 | ##### setDate(date) 86 | Set the current date with a new date, parameter date type is String or Date . 87 | ``` 88 | $().datepicker('setDate', '2016-02-09'); 89 | $().datepicker('setDate', new Date(2016, 1, 9)); 90 | ``` 91 | 92 | ##### getDate() 93 | Get the current date. 94 | ``` 95 | $().datepicker('getDate'); 96 | ``` 97 | 98 | ##### clear() 99 | Clear the picker date (when date is cleared, the current date is displayed by default). 100 | ``` 101 | $().datepicker('clear'); 102 | ``` 103 | 104 | ##### show() 105 | Show the picker panel. 106 | ``` 107 | $().datepicker('show'); 108 | ``` 109 | 110 | ##### hide() 111 | hide the picker panel. 112 | ``` 113 | $().datepicker('hide'); 114 | ``` 115 | 116 | ##### disable(value) 117 | disable or enable the picker, if parameter value is true that can disable the picker, otherwise can enable the picker. 118 | ``` 119 | // disable the picker 120 | $().datepicker('disable', true); 121 | // enable the picker 122 | $().datepicker('disable', false); 123 | ``` 124 | 125 | ##### destroy() 126 | Destroy the picker and remove the instance from target element. 127 | ``` 128 | $().datepicker('destroy'); 129 | ``` 130 | 131 | ### Events 132 | > Common usage 133 | 134 | ``` 135 | $().on(eventName, function (e, arguments) { 136 | // todo 137 | }); 138 | ``` 139 | 140 | ##### pick.datepicker 141 | This event fires when date is changed. 142 | * event ( Type: Object ) 143 | * newDate ( Type: String ) 144 | * oldDate ( Type: String ) 145 | 146 | ``` 147 | $().on('pick.datepicker', function (event) { 148 | console.log('newDate: ' + event.newDate); 149 | console.log('oldDate: ' + event.oldDate); 150 | }); 151 | ``` 152 | 153 | ##### show.datepicker 154 | This event fires when picker is show. 155 | 156 | ``` 157 | $().on('show.datepicker', function (e) { 158 | // todo 159 | }); 160 | ``` 161 | 162 | ##### hide.datepicker 163 | This event fires when picker is hide. 164 | 165 | ``` 166 | $().on('hide.datepicker', function (e) { 167 | // todo 168 | }); 169 | ``` 170 | ### Callbacks 171 | > Common usage 172 | 173 | ``` 174 | $().datepicker({ 175 | CallbackName: function () { 176 | // todo 177 | } 178 | }); 179 | ``` 180 | ##### onChange 181 | A shortcut of the "pick.datepicker" event, this callback called when picker value is changed. 182 | 183 | ``` 184 | $().datepicker({ 185 | onChange: function (events) { 186 | console.log('newDate: ' + event.newDate); 187 | console.log('oldDate: ' + event.oldDate); 188 | } 189 | }); 190 | ``` 191 | 192 | ##### onShow 193 | A shortcut of the "show.datepicker" event, this callback called when picker is show. 194 | 195 | ``` 196 | $().datepicker({ 197 | onShow: function () { 198 | // todo 199 | } 200 | }); 201 | ``` 202 | ##### onHide 203 | A shortcut of the "hide.datepicker" event, this callback called when picker is hide. 204 | 205 | ``` 206 | $().datepicker({ 207 | onHide: function () { 208 | // todo 209 | } 210 | }); 211 | ``` 212 | 213 | 214 | ### Locale 215 | > I18n config, default language is en-US 216 | 217 | ##### Usage 218 | ``` 219 | 220 | 221 | 226 | ``` 227 | 228 | ### Run example 229 | > Please download the project, and then enter into this directory.(download gulp-sass plugin need to connect vpn) 230 | 231 | + npm install 232 | + gulp 233 | + Access "http://localhost:8081/examples/index.html" in browser 234 | 235 | 236 | ### Browser support 237 | * Chrome Most versions 238 | * Firefox Most versions 239 | * Safari Most versions 240 | * Opera Most versions 241 | * Edge Most versions 242 | * Internet Explorer 8+ 243 | 244 | ### Author 245 | Greg Zhang from Baidu (gregzhang616@gmail.com). 246 | 247 | ### Remarks 248 | Thanks for the eleme UED team to provide such a good UI design. 249 | -------------------------------------------------------------------------------- /dist/assets/css/demo.css: -------------------------------------------------------------------------------- 1 | html { 2 | height: 100%; 3 | } 4 | 5 | body { 6 | height: 100%; 7 | } 8 | 9 | /* Guideline page */ 10 | .datepicker-demo-guide__list { 11 | font-size: 14px; 12 | } 13 | 14 | .datepicker-demo-guide__list a { 15 | color: #038cd6; 16 | } 17 | /* Guideline page */ 18 | 19 | .datepicker-demo__header { 20 | width: 100%; 21 | height: 90px; 22 | margin-bottom: -90px; 23 | background-color: #038cd6; 24 | } 25 | 26 | .datepicker-demo__main { 27 | min-height: 100%; 28 | box-sizing: border-box; 29 | padding-bottom: 130px; 30 | } 31 | 32 | .datepicker-demo__main__container { 33 | min-height: 580px; 34 | padding: 20px 30px; 35 | border: 1px solid #eaeefb; 36 | border-radius: 2px; 37 | transition: all .3s; 38 | margin-bottom: 20px; 39 | overflow: hidden; 40 | clear: both; 41 | } 42 | 43 | .datepicker-demo__main__container:hover { 44 | box-shadow: 0 0 8px 0 rgba(232,237,250,.6), 0 2px 4px 0 rgba(232,237,250,.5); 45 | } 46 | 47 | .datepicker-demo__main__container .gmi-input { 48 | width: 200px; 49 | height: 30px; 50 | -webkit-appearance: none; 51 | -moz-appearance: none; 52 | border-radius: 2px; 53 | border: 1px solid #bfcbd9; 54 | -moz-box-sizing: border-box; 55 | box-sizing: border-box; 56 | color: #1f2d3d; 57 | line-height: 1; 58 | outline: none; 59 | padding: 3px 10px; 60 | font-size: 13px; 61 | } 62 | 63 | .datepicker-demo-button-area { 64 | width: 33.33%; 65 | height: 360px; 66 | float: right; 67 | text-align: center; 68 | } 69 | 70 | .datepicker-demo-example-area { 71 | width: 33.33%; 72 | height: 360px; 73 | float: left; 74 | text-align: center; 75 | } 76 | 77 | .datepicker-demo-events-area { 78 | width: 33.33%; 79 | height: 360px; 80 | float: right; 81 | text-align: center; 82 | } 83 | 84 | .gmi-button.primary { 85 | display: inline-block; 86 | width: 100%; 87 | max-width: 200px; 88 | height: 32px; 89 | line-height: 22px; 90 | padding: 5px 10px; 91 | text-align: center; 92 | background-color: #038cd6; 93 | border-radius: 2px; 94 | color: #fff; 95 | -webkit-appearance: none; 96 | -moz-appearance: none; 97 | border: none; 98 | outline: none; 99 | cursor: pointer; 100 | font-size: 13px; 101 | white-space: nowrap; 102 | text-overflow: ellipsis; 103 | overflow: hidden; 104 | vertical-align: middle; 105 | } 106 | 107 | .gmi-button.primary:active { 108 | background-color: #037ec1; 109 | } 110 | 111 | .datepicker-demo__header .container{ 112 | height: 100%; 113 | overflow: hidden; 114 | } 115 | 116 | .datepicker-demo__header img, .datepicker-demo__header h3 { 117 | float: left; 118 | } 119 | 120 | .datepicker-demo__header img { 121 | margin-top: 17px; 122 | margin-right: 8px; 123 | } 124 | 125 | .datepicker-demo__header h3 { 126 | color: #fff; 127 | margin-top: 33px; 128 | } 129 | 130 | .events-content { 131 | font-size: 14px; 132 | min-height: 20px; 133 | } 134 | 135 | .callback-content { 136 | font-size: 14px; 137 | min-height: 20px; 138 | } 139 | 140 | .datepicker-demo__footer { 141 | height: 80px; 142 | background-color: #324057; 143 | font-size: 24px; 144 | width: 100%; 145 | margin-top: -80px; 146 | } 147 | 148 | .datepicker-demo__footer .container { 149 | height: 100%; 150 | line-height: 1; 151 | color: #a4aebd; 152 | } 153 | 154 | .datepicker-demo__footer__inner { 155 | height: 100%; 156 | } 157 | 158 | .datepicker-demo__footer__inner > li { 159 | padding-top: 20px; 160 | float: left; 161 | } 162 | 163 | .datepicker-demo__footer__inner > li:last-child { 164 | float: right; 165 | } 166 | 167 | .footer-title { 168 | padding-left: 32px; 169 | background: url("/assets/images/gemini-dark.png") no-repeat left center transparent; 170 | -webkit-background-size: 26px 28px; 171 | background-size: 26px 28px; 172 | } 173 | 174 | .footer-title--feedback { 175 | padding-left: 32px; 176 | font-size: 14px; 177 | color: #a4aebd; 178 | } 179 | 180 | .footer-title--feedback:hover { 181 | text-decoration: none; 182 | } 183 | 184 | .footer-github-icon { 185 | display: block; 186 | width: 32px; 187 | height: 32px; 188 | background: url("/assets/images/github-dark.png") no-repeat center center transparent; 189 | background-size: 100% 100%; 190 | -webkit-transition: all 0.3s; 191 | -moz-transition: all 0.3s; 192 | -ms-transition: all 0.3s; 193 | -o-transition: all 0.3s; 194 | transition: all 0.3s; 195 | } 196 | 197 | .footer-github-icon:hover { 198 | background-image: url("/assets/images/github-white.png"); 199 | transform: scale(1.2, 1.2); 200 | -ms-transform: scale(1.2, 1.2); 201 | -webkit-transform: scale(1.2, 1.2); 202 | } 203 | 204 | .container { 205 | width: 1170px; 206 | margin: 0 auto; 207 | color: #5e5e5e; 208 | } 209 | 210 | .padding-t-huge { 211 | padding-top: 140px; 212 | } 213 | 214 | .padding-t-lg { 215 | padding-top: 50px; 216 | } 217 | 218 | .margin-b-md { 219 | margin-bottom: 15px; 220 | } 221 | 222 | .margin-b-sm { 223 | margin-bottom: 10px; 224 | } 225 | 226 | .margin-t-lg { 227 | margin-top: 30px; 228 | } 229 | -------------------------------------------------------------------------------- /dist/assets/css/reset.css: -------------------------------------------------------------------------------- 1 | blockquote, body, button, dd, dl, dt, fieldset, h1, h2, h3, h4, h5, h6, hr, input, lengend, li, ol, p, pre, td, textarea, th, ul { 2 | margin: 0; 3 | padding: 0 4 | } 5 | 6 | body, button, input, select, textarea { 7 | font: 12px Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif 8 | } 9 | 10 | h1 { 11 | font-size: 36px; 12 | font-weight: 400; 13 | } 14 | 15 | h2 { 16 | font-size: 28px; 17 | font-weight: 400; 18 | } 19 | 20 | h3 { 21 | font-size: 24px; 22 | font-weight: 400; 23 | } 24 | 25 | h4, h5, h6 { 26 | font-size: 18px; 27 | font-weight: 400; 28 | } 29 | 30 | button, input, select, textarea { 31 | font-size: 100% 32 | } 33 | 34 | address, cite, dfn, em, var { 35 | font-style: normal 36 | } 37 | 38 | code, kbd, pre, samp, tt { 39 | font-family: "Courier New", Courier, monospace 40 | } 41 | 42 | small { 43 | font-size: 12px 44 | } 45 | 46 | ol, ul { 47 | list-style: none 48 | } 49 | 50 | a { 51 | text-decoration: none 52 | } 53 | 54 | a:hover { 55 | text-decoration: underline 56 | } 57 | 58 | table { 59 | border-collapse: collapse; 60 | border-spacing: 0 61 | } 62 | 63 | hr { 64 | border: none; 65 | height: 1px 66 | } 67 | 68 | html { 69 | overflow-y: scroll 70 | } 71 | -------------------------------------------------------------------------------- /dist/assets/images/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/arrow-down.png -------------------------------------------------------------------------------- /dist/assets/images/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/arrow-up.png -------------------------------------------------------------------------------- /dist/assets/images/datepicker-date-range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/datepicker-date-range.png -------------------------------------------------------------------------------- /dist/assets/images/datepicker-date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/datepicker-date.png -------------------------------------------------------------------------------- /dist/assets/images/datepicker-datetime-range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/datepicker-datetime-range.png -------------------------------------------------------------------------------- /dist/assets/images/datepicker-datetime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/datepicker-datetime.png -------------------------------------------------------------------------------- /dist/assets/images/datepicker-month.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/datepicker-month.png -------------------------------------------------------------------------------- /dist/assets/images/datepicker-year.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/datepicker-year.png -------------------------------------------------------------------------------- /dist/assets/images/double-arrow-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/double-arrow-left.png -------------------------------------------------------------------------------- /dist/assets/images/double-arrow-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/double-arrow-right.png -------------------------------------------------------------------------------- /dist/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/favicon.ico -------------------------------------------------------------------------------- /dist/assets/images/gemini-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/gemini-dark.png -------------------------------------------------------------------------------- /dist/assets/images/gemini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/gemini.png -------------------------------------------------------------------------------- /dist/assets/images/github-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/github-dark.png -------------------------------------------------------------------------------- /dist/assets/images/github-gemini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/github-gemini.png -------------------------------------------------------------------------------- /dist/assets/images/github-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/github-white.png -------------------------------------------------------------------------------- /dist/assets/images/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/left.png -------------------------------------------------------------------------------- /dist/assets/images/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/dist/assets/images/right.png -------------------------------------------------------------------------------- /dist/assets/js/demo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Greg Zhang. 3 | */ 4 | (function ($) { 5 | var $tplEle; 6 | var $datepicker; 7 | var datepicker; 8 | var compileData = { 9 | title: 'Date', 10 | description: 'Basic date picker measured by "date".', 11 | format: '', 12 | align: '' 13 | }; 14 | 15 | $('ul.datepicker-demo-guide__list').find('>li a').on('click', function() { 16 | var $a = $(this); 17 | var $indexContainer = $('.datepicker-index-container'); 18 | var $insContainer = $('.datepicker-demo__main'); 19 | var type = $a.data('role'); 20 | var tpl; 21 | switch (type) { 22 | case 'date': 23 | compileData.format = 'yyyy-MM-dd'; 24 | compileData.defaultValue = '2017-01-18'; 25 | break; 26 | case 'datetime': 27 | compileData.title = 'Datetime'; 28 | compileData.description = 'Basic date picker measured by "datetime".'; 29 | compileData.format = 'MM/dd/yyyy HH:mm:ss'; 30 | compileData.align = 'right'; 31 | compileData.defaultValue = '02/26/2017 13:18:16'; 32 | break; 33 | case 'year': 34 | compileData.title = 'Year'; 35 | compileData.description = 'Basic date picker measured by "year".'; 36 | compileData.format = 'yyyy'; 37 | compileData.defaultValue = '2016'; 38 | break; 39 | case 'month': 40 | compileData.title = 'Month'; 41 | compileData.description = 'Basic date picker measured by "month".'; 42 | compileData.format = 'MM/yyyy'; 43 | compileData.defaultValue = '01/2017'; 44 | break; 45 | case 'date-range': 46 | compileData.title = 'Range date'; 47 | compileData.description = 'Basic date picker measured by "range date".'; 48 | break; 49 | case 'datetime-range': 50 | compileData.title = 'Range datetime'; 51 | compileData.description = 'Basic date picker measured by "range datetime".'; 52 | compileData.format = 'dd/MM/yyyy-HH:mm:ss'; 53 | compileData.align = 'center'; 54 | compileData.defaultValue = '30/12/2016-18:42:38 - 03/02/2017-08:29:16'; 55 | break; 56 | default: 57 | break; 58 | } 59 | tpl = Handlebars.compile($('#tpl-datepicker').html())(compileData); 60 | if ($tplEle && $tplEle.length > 0) $tplEle.remove(); 61 | $tplEle = $(tpl).appendTo($insContainer); 62 | $indexContainer.hide(); 63 | // init datepicker 64 | $datepicker = $('#gmi-datepicker--input').datepicker({ 65 | type: type, 66 | format: compileData.format, 67 | align: compileData.align !== '' ? compileData.align : 'left', 68 | weekStart: 1, 69 | startDate: $.getPrevYear(new Date()), 70 | endDate: getPrevDate(), 71 | defaultValue: compileData.defaultValue, 72 | onChange: function (event) { 73 | $('.callback-content[data-role=change]').text(event.newDate); 74 | $('.events-content[data-role=pick]').text(event.newDate); 75 | $('.gmi-datepicker-button--input').val(event.newDate); 76 | } 77 | }); 78 | 79 | datepicker = $datepicker.data('datepicker'); 80 | // show format attribute 81 | $('.attr-content[data-role=format]').text(compileData.format !== '' ? compileData.format : datepicker.format); 82 | // show align attribute 83 | $('.attr-content[data-role=align]').text(datepicker.align !== '' ? datepicker.align : datepicker.align); 84 | 85 | // bind events 86 | _bindEvent(); 87 | }); 88 | 89 | function _bindEvent () { 90 | // bind show event 91 | $datepicker.on('show.datepicker', function (e) { 92 | var eventType = e.type; 93 | $('.events-content').filter('[data-role='+ eventType +']').text('true'); 94 | $('.events-content').filter('[data-role=hide]').text('false'); 95 | }); 96 | 97 | // bind hide event 98 | $datepicker.on('hide.datepicker', function (e) { 99 | var eventType = e.type; 100 | $('.events-content').filter('[data-role='+ eventType +']').text('true'); 101 | $('.events-content').filter('[data-role=show]').text('false'); 102 | }); 103 | 104 | // bind pick event 105 | $datepicker.on('pick.datepicker', function (e) { 106 | console.log(arguments); 107 | }); 108 | 109 | $('.gmi-button').on('click', function (e) { 110 | var $self = $(this); 111 | var action = $self.data('action'); 112 | var value; 113 | switch (action) { 114 | case 'setDate': 115 | value = $('.gmi-datepicker-button--input').filter('[data-action='+ action +']').val(); 116 | $datepicker.datepicker('setDate', value); 117 | break; 118 | case 'getDate': 119 | value = $datepicker.datepicker('getDate'); 120 | alert(value); 121 | break; 122 | case 'show': 123 | $datepicker.datepicker('show'); 124 | break; 125 | case 'hide': 126 | $datepicker.datepicker('hide'); 127 | break; 128 | case 'disable': 129 | $datepicker.datepicker('disable', true); 130 | break; 131 | case 'enable': 132 | $datepicker.datepicker('disable', false); 133 | break; 134 | case 'clear': 135 | $datepicker.datepicker('clear'); 136 | break; 137 | case 'destroy': 138 | $datepicker.datepicker('destroy'); 139 | break; 140 | default: 141 | break; 142 | } 143 | e.stopPropagation(); 144 | }); 145 | } 146 | 147 | // Utils 148 | function getPrevDate () { 149 | var now = new Date(); 150 | var newDate = now.getTime() - (1000 * 3600 * 24); 151 | return new Date(newDate); 152 | } 153 | })(jQuery); 154 | -------------------------------------------------------------------------------- /dist/css/jquery.datepicker.css: -------------------------------------------------------------------------------- 1 | .gmi-date-picker { 2 | width: 254px; 3 | -webkit-transition: all ease-in-out 0.2s; 4 | transition: all ease-in-out 0.2s; } 5 | .gmi-date-picker.has-time { 6 | width: 324px; } 7 | .gmi-date-picker__header__icon-btn { 8 | display: inline-block; 9 | width: 16px; 10 | height: 16px; 11 | vertical-align: middle; 12 | margin: 3px 0; 13 | float: right; 14 | cursor: pointer; 15 | color: #475669 !important; } 16 | .gmi-date-picker__header__icon-btn:hover { 17 | color: #038cd6; } 18 | .gmi-date-picker[data-role='year'] .gmi-date-picker__header__label--year:hover { 19 | color: #475669 !important; 20 | cursor: default; } 21 | 22 | .gmi-picker-panel { 23 | line-height: 20px; 24 | color: #475669; 25 | background-color: #fff; 26 | border: 1px solid #d3dce6; 27 | border-radius: 2px; 28 | -webkit-box-shadow: 0 2px 5px #ccc; 29 | box-shadow: 0 2px 5px #ccc; 30 | margin: 5px 0; 31 | z-index: 2008; } 32 | .gmi-picker-panel span { 33 | color: #475669; 34 | font-size: 14px; 35 | padding: 0 3px; 36 | cursor: pointer; } 37 | .gmi-picker-panel span:first-child { 38 | padding-left: 0; } 39 | .gmi-picker-panel span:hover { 40 | color: #038cd6; 41 | text-decoration: none; } 42 | .gmi-picker-panel__body { 43 | width: 100%; 44 | height: 100%; } 45 | .gmi-picker-panel__body__header { 46 | line-height: 22px; 47 | padding: 12px 20px 5px; } 48 | .gmi-picker-panel__body__header span[class^=gmi-date-picker__header__label--] { 49 | color: #475669 !important; } 50 | .gmi-picker-panel__body__header span[class^=gmi-date-picker__header__label--]:hover { 51 | color: #038cd6 !important; } 52 | .gmi-picker-panel .gmi-year-picker__header, .gmi-picker-panel .gmi-month-picker__header { 53 | padding-bottom: 10px; } 54 | .gmi-picker-panel__body__header--time { 55 | padding: 8px; 56 | border-bottom: 1px solid #d3dce6; 57 | min-height: 30px; } 58 | .gmi-picker-panel__body__header--time__wrapper { 59 | width: 50%; 60 | float: left; 61 | padding: 0 5px; 62 | -webkit-box-sizing: border-box; 63 | box-sizing: border-box; } 64 | .gmi-picker-panel__body__header--time__wrapper .gmi-input { 65 | width: 100%; 66 | display: inline-block; } 67 | .gmi-picker-panel__body__header--time__wrapper .gmi-input__inner { 68 | width: 100%; 69 | height: 30px; 70 | -webkit-appearance: none; 71 | -moz-appearance: none; 72 | border-radius: 2px; 73 | border: 1px solid #bfcbd9; 74 | -webkit-box-sizing: border-box; 75 | box-sizing: border-box; 76 | color: #1f2d3d; 77 | display: block; 78 | line-height: 1; 79 | outline: none; 80 | padding: 3px 10px; 81 | font-size: 13px; 82 | -webkit-transition: border-color 0.4s cubic-bezier(0.645, 0.045, 0.355, 1); 83 | transition: border-color 0.4s cubic-bezier(0.645, 0.045, 0.355, 1); } 84 | .gmi-picker-panel__body__header--time__wrapper .gmi-input__inner:hover { 85 | border: 1px solid #038cd6; } 86 | .gmi-picker-panel__body__header--time__wrapper .gmi-time-picker--wrapper { 87 | position: relative; 88 | zoom: 1; } 89 | .gmi-picker-panel__btn--prev { 90 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABKElEQVRYR+2W/61BQRCFPxVQgg7o4NEBFXgqoIRXAhWgAjpAB3SghPcqIEdmEjZcuxsvN5KdP++v8805s5PboOZq1KxPASgOFAc+2oEWsLA9MgZ+c3ZKrgNtYA10TfQA9HMgcgAkugXkgDpXyYkTMAQEE12pAKH40pS+DUIxyIloiBQAF9c7EtwEberaDDinQMQCDKxDPd+r6FCQuxSIGAC39++FuBviEE2bEY/p4Vy8AkgVT4aoAnDxI6AINOUppaOqOelUOfEMQMM0ASSuzLOWjB1VzYQgpsA87OARgDIbvUHctbQvHELf9t1xvR8CuPjebM/tPGxUEIrjC7iDuAVw21d2zlPyjn3WG1QUiuTOgR/L7HrjH0uNylnplZ/S4kBxoDhQvwMXBcA9IYMw4zYAAAAASUVORK5CYII=) no-repeat center center; 91 | background-size: 100% 100%; } 92 | .gmi-picker-panel__btn--next { 93 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABOElEQVRYR+2U0VHDMBAFNxVAB9ABKSGUQAVABZAO6CBQAVBB6ABKgA4oIVQAszMSI0ywfbEz5kP681i697TvTjMmXrOJ9akGKoFK4F8RuAEOgOWe34ZbYAOo9+Md8McV8ABc7smEtc+BO+C6acDvvOEFOEtOx/ByCKyBBfAIXOSi23ogm3gFTkcwofgzMG+KbyOQjYlnBQw1UYp/Yy+Rtk2BmO6TCeN4D2ZxnLB7c3tKsr9W1xhmE3atcUikz1JU7BL4U7wtglIkaqK3eF8D7rOok/HZQSKLS1bjT124uiIoz5cmxNosrqCNa03HrVdcEQMlCV/MMtsc00dEPBJBk4S3PypeTKclLL6rAc/Z3fbESXL2lm7utIRWNIKyuCbybBtBWHwIgdAt2zYPITCKiWqgEqgEJifwBe9kPSFgrTUbAAAAAElFTkSuQmCC) no-repeat center center; 94 | background-size: 100% 100%; 95 | margin-left: 15px; } 96 | .gmi-picker-panel__body__main { 97 | min-width: 224px; 98 | padding: 0 15px 15px; } 99 | .gmi-picker-panel table { 100 | width: 100%; 101 | table-layout: fixed; 102 | border-collapse: collapse; 103 | border-spacing: 0; } 104 | .gmi-picker-panel .gmi-date-table { 105 | font-size: 12px !important; 106 | min-width: 224px; 107 | -webkit-user-select: none; } 108 | .gmi-picker-panel .gmi-date-table th { 109 | padding: 5px; 110 | color: #8492a6; 111 | font-size: 12px !important; 112 | font-weight: 400; 113 | text-align: center; } 114 | .gmi-picker-panel .gmi-date-table td { 115 | width: 32px; 116 | height: 32px; 117 | -webkit-box-sizing: border-box; 118 | box-sizing: border-box; 119 | text-align: center; 120 | cursor: pointer; 121 | vertical-align: middle; 122 | font-size: 12px !important; 123 | color: #475669; } 124 | .gmi-picker-panel .gmi-date-table td.today { 125 | color: #038cd6; } 126 | .gmi-picker-panel .gmi-date-table td.current { 127 | background-color: #038cd6; 128 | color: #fff; } 129 | .gmi-picker-panel .gmi-date-table td.disabled { 130 | background-color: #f5f5f5; 131 | opacity: 1; 132 | cursor: not-allowed; 133 | color: #ddd; } 134 | .gmi-picker-panel .gmi-date-table td.disabled:hover { 135 | background-color: #f5f5f5 !important; } 136 | .gmi-picker-panel .gmi-date-table td.available:not(.current):hover { 137 | background-color: #e5e9f2; } 138 | .gmi-picker-panel .gmi-date-table td.next-month, .gmi-picker-panel .gmi-date-table td.prev-month { 139 | color: #ddd; } 140 | .gmi-picker-panel .gmi-date-table td.in-range { 141 | background-color: #c2dcef; } 142 | .gmi-picker-panel .gmi-date-table td.in-range:hover { 143 | background-color: #c2dcef !important; } 144 | .gmi-picker-panel .gmi-date-table td.start-date, .gmi-picker-panel .gmi-date-table td.end-date { 145 | background-color: #038cd6; 146 | color: #fff; } 147 | .gmi-picker-panel .gmi-date-table td.start-date:hover, .gmi-picker-panel .gmi-date-table td.end-date:hover { 148 | background-color: #038cd6 !important; } 149 | .gmi-picker-panel .gmi-year-table, .gmi-picker-panel .gmi-month-table { 150 | font-size: 12px !important; 151 | min-width: 224px; 152 | -webkit-user-select: none; } 153 | .gmi-picker-panel .gmi-year-table td, .gmi-picker-panel .gmi-month-table td { 154 | padding: 22px 3px; 155 | vertical-align: middle; } 156 | .gmi-picker-panel .gmi-year-table td .cell, .gmi-picker-panel .gmi-month-table td .cell { 157 | height: 32px; 158 | display: block; 159 | line-height: 32px; 160 | text-align: center; 161 | cursor: pointer; 162 | font-size: 12px !important; 163 | color: #475669 !important; } 164 | .gmi-picker-panel .gmi-year-table td .cell:not(.current):hover, .gmi-picker-panel .gmi-month-table td .cell:not(.current):hover { 165 | background-color: #e5e9f2; } 166 | .gmi-picker-panel .gmi-year-table td.current .cell, .gmi-picker-panel .gmi-month-table td.current .cell { 167 | background-color: #038cd6 !important; 168 | color: #fff !important; } 169 | .gmi-picker-panel .gmi-year-table td.disabled .cell, .gmi-picker-panel .gmi-month-table td.disabled .cell { 170 | background-color: #f5f5f5; 171 | opacity: 1; 172 | cursor: not-allowed; 173 | color: #ddd !important; } 174 | .gmi-picker-panel .gmi-year-table td.disabled .cell:hover, .gmi-picker-panel .gmi-month-table td.disabled .cell:hover { 175 | background-color: #f5f5f5 !important; } 176 | .gmi-picker-panel__footer { 177 | padding: 0 8px; 178 | border-top: 1px solid #d3dce6; 179 | text-align: right; 180 | background-color: #fff; } 181 | .gmi-picker-panel__footer .gmi-picker-panel__link-btn { 182 | display: inline-block; 183 | color: #038cd6; 184 | padding: 10px 5px; } 185 | .gmi-picker-panel__footer .gmi-picker-panel__link-btn--default { 186 | color: #8391a5; } 187 | .gmi-picker-panel__footer .gmi-picker-panel__link-btn--primary { 188 | color: #038cd6; } 189 | .gmi-picker-panel__footer .gmi-picker-panel__link-btn:hover { 190 | text-decoration: none; } 191 | .gmi-picker-panel__footer .gmi-picker-panel__link-btn.disabled { 192 | color: #ccc; 193 | cursor: not-allowed; } 194 | .gmi-picker-panel.placement-left-bottom { 195 | -ms-transform-origin: 0 bottom !important; 196 | -webkit-transform-origin: 0 bottom !important; 197 | transform-origin: 0 bottom !important; } 198 | .gmi-picker-panel.placement-center-bottom { 199 | -ms-transform-origin: 50% bottom !important; 200 | -webkit-transform-origin: 50% bottom !important; 201 | transform-origin: 50% bottom !important; } 202 | .gmi-picker-panel.placement-right-bottom { 203 | -ms-transform-origin: 100% bottom !important; 204 | -webkit-transform-origin: 100% bottom !important; 205 | transform-origin: 100% bottom !important; } 206 | 207 | .gmi-date-range-picker { 208 | width: 520px; 209 | -webkit-transition: all ease-in-out 0.2s; 210 | transition: all ease-in-out 0.2s; } 211 | .gmi-date-range-picker.has-time { 212 | width: 660px; } 213 | .gmi-date-range-picker__body { 214 | clear: both; 215 | overflow: hidden; } 216 | .gmi-date-range-picker__body__header { 217 | font-size: 14px; 218 | text-align: center; 219 | position: relative; 220 | padding-bottom: 5px; } 221 | .gmi-date-range-picker__body .gmi-picker-panel__body__main { 222 | width: 50%; 223 | -webkit-box-sizing: border-box; 224 | box-sizing: border-box; 225 | margin: 0; 226 | padding: 15px; } 227 | .gmi-date-range-picker__header--time__wrapper .gmi-input { 228 | float: left; 229 | width: 50%; 230 | padding: 0 5px; 231 | -webkit-box-sizing: border-box; 232 | box-sizing: border-box; } 233 | .gmi-date-range-picker__header__icon-btn { 234 | position: absolute; 235 | top: 0; 236 | cursor: pointer; 237 | width: 16px; 238 | height: 16px; } 239 | .gmi-date-range-picker__header__icon-btn:hover { 240 | color: #038cd6; } 241 | .gmi-date-range-picker__btn--prev { 242 | left: 5px; 243 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABHklEQVRYR8XXuw3CMBCA4TsaRAWjwAYYJqBBpCNlYB6UEqiQ2AElI2QERmCCGBkUkSiJ48edoaEx/J8iRb5DIPikt2yZRCI3+avTPZurc8etKNQ3mvxIdya9PfaAeAaQl2S3jnVnVRxLmX3CEhdJJJ5egF8cAKSMk2h96QNUcQSYSQnXQ7Taez0BirgzgCruBKCMWwOo41YAjrgxgCtuBOCMDwK441pAiHgvIFS8ExAy3gKEjjcA/4h7AUZlmQPgVAIUkzGKeCNeLld74zq2fQoUiNY8EBrROZCERPRORKEQ2pEsBGJwJuRGDALUq8WJMAJwIowBXAgrAAfCGkCNcAJQIpwBVAgvQB1R3/d0++H3AlO75GjuvZxWIZ/1/A1dhe0wdsJuuwAAAABJRU5ErkJggg==) no-repeat center center; 244 | background-size: 100% 100%; } 245 | .gmi-date-range-picker__btn--prev-month { 246 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAr0lEQVRYR8XVsRECMQxEUbk1aAIiIISCiI+ILmjNzAWkjFb6O3YD/8nJjlj8xuJ+WADP92cbIy5zxutxPlz/HYkDlPgOQwFqHAVU4higGkcAnXgb0I23AES8DKDiJQAZlwF0XAI44mmAK54COOMSIGJu99PxRs93aox+v+BApAD71S5EGuBCSAAHQgbQiBKARJQBFKIFIBBtQBeBADoIDFBFoIAKAgeoCAtAWczlgC8d87YhVW+y5wAAAABJRU5ErkJggg==) no-repeat center center; 247 | background-size: 100% 100%; 248 | left: 25px; } 249 | .gmi-date-range-picker__btn--next { 250 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABLUlEQVRYR8XXsRGCMBQG4PdcQEbQCXQDT1kCKrWESodRSrHizsYJFDbRLdQmzyOcHByKeWgSGpq8+z9S5CcIlh/M86PktMjfge/GHM/mkI5RiHnouWvOXHUt7o6pc3+IKwD2gWjJQWyTc4YIEwCKA89ddkHIHci/pCdExkUUeMoAYNQVIQE2ESXAFqIGsIFoAEwj3gJMIj4CTCFaASYQXwG6EUoAnQhlgC4EC6ADwQaU7Ym4k2c44TDwp1eVIoqSdABIl2KuKD42oKhgShHA4bRnXly3h5wbE8E+9GfyF4AF+Hc4C6AjXBmgK1wJoDP8K0B3eCvARPhHgKnwtwCT4Q2A6fAawEZ4CbAVLgH/uBlVz3aVUqqu+flu2BNiEXjuihv8Ws8qo64hbXPWAU9Lh/8w7QLSzwAAAABJRU5ErkJggg==) no-repeat center center; 251 | background-size: 100% 100%; 252 | right: 5px; } 253 | .gmi-date-range-picker__btn--next-month { 254 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAx0lEQVRYR8XXvQ3CMBBA4fMGjITCElCFlDBQ2oQqZTaAtaAySkGL7+ed4t5+n1z45CI7r7JzX5qAcXnOpUgvUufb+TTQ4CZgC2YiVIBMhBqQhTABMhBmAI1wAUiEG0AhQgACEQZEEQgggsAAXgQK8CBwgBWRCqhVHvdLd/03QXHAb3Jq4hsMBVjjKMATxwDeOAKIxMOAaDwEIOJuABV3Aci4GUDHTYCMuBqQFW8CpvV1eH/qKiJH7dtu/bqhs8Aab96A50Drni+AWrkh0KGJCQAAAABJRU5ErkJggg==) no-repeat center center; 255 | background-size: 100% 100%; 256 | right: 25px; } 257 | .gmi-date-range-picker .f-lt { 258 | float: left; 259 | border-right: 1px solid #d3dce6; } 260 | .gmi-date-range-picker .f-rt { 261 | float: right; } 262 | 263 | .gmi-time-panel { 264 | margin: 5px 0; 265 | color: #475669; 266 | background-color: #fff; 267 | border: 1px solid #d1dbe5; 268 | -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04); 269 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04); 270 | border-radius: 2px; 271 | -webkit-transform-origin: center top 0; 272 | -ms-transform-origin: center top 0; 273 | transform-origin: center top 0; 274 | z-index: 2011; 275 | -webkit-user-select: none; 276 | -moz-user-select: none; 277 | -ms-user-select: none; 278 | user-select: none; } 279 | .gmi-time-panel__body { 280 | width: 100%; 281 | height: 100%; 282 | position: relative; 283 | overflow: hidden; } 284 | .gmi-time-panel__body:before { 285 | content: ":"; 286 | padding-left: 33.33333%; 287 | top: 50%; 288 | color: #fff; 289 | position: absolute; 290 | font-size: 14px; 291 | -webkit-transform: translateY(-50%); 292 | -ms-transform: translateY(-50%); 293 | transform: translateY(-50%); 294 | line-height: 16px; 295 | background-color: #039cef; 296 | height: 32px; 297 | left: 0; 298 | right: 0; 299 | -webkit-box-sizing: border-box; 300 | box-sizing: border-box; 301 | padding-top: 6px; 302 | text-align: left; } 303 | .gmi-time-panel__body:after { 304 | content: ":"; 305 | top: 50%; 306 | color: #fff; 307 | position: absolute; 308 | font-size: 14px; 309 | -webkit-transform: translateY(-50%); 310 | -ms-transform: translateY(-50%); 311 | transform: translateY(-50%); 312 | line-height: 16px; 313 | background-color: #039cef; 314 | height: 32px; 315 | left: 66.66667%; 316 | right: 0; 317 | -webkit-box-sizing: border-box; 318 | box-sizing: border-box; 319 | padding-top: 6px; 320 | text-align: left; } 321 | .gmi-time-panel__body__item { 322 | width: 33.33%; 323 | height: 100%; 324 | overflow: hidden; 325 | position: relative; 326 | z-index: 1; 327 | float: left; 328 | text-align: center; } 329 | .gmi-time-panel__body__item--spinner { 330 | width: 100%; 331 | max-height: 192px; } 332 | .gmi-time-panel__body__item--spinner:before { 333 | content: " "; 334 | display: block; 335 | width: 100%; 336 | height: 80px; } 337 | .gmi-time-panel__body__item--spinner:after { 338 | content: " "; 339 | display: block; 340 | width: 100%; 341 | height: 80px; } 342 | .gmi-time-panel__body__item--spinner__item { 343 | height: 32px; 344 | line-height: 32px; 345 | font-size: 12px; 346 | cursor: pointer; } 347 | .gmi-time-panel__body__item--spinner__item.active { 348 | color: #fff; } 349 | .gmi-time-panel__body__item--spinner__item.active:hover { 350 | cursor: default; } 351 | .gmi-time-panel__body__item--spinner__item.disabled { 352 | color: #cecece; 353 | cursor: not-allowed; } 354 | 355 | .picker-show { 356 | animation: showPanel 0.2s ease-in-out; 357 | -webkit-animation: showPanel 0.2s ease-in-out; 358 | -webkit-animation-fill-mode: forwards; 359 | animation-fill-mode: forwards; } 360 | 361 | .picker-hide { 362 | animation: hidePanel 0.2s ease-in-out; 363 | -webkit-animation: hidePanel 0.2s ease-in-out; 364 | -webkit-animation-fill-mode: forwards; 365 | animation-fill-mode: forwards; } 366 | 367 | @-webkit-keyframes showPanel { 368 | 0% { 369 | opacity: 0; 370 | -webkit-transform: scale(0, 0); 371 | transform: scale(0, 0); 372 | -ms-transform: scale(0, 0); } 373 | 100% { 374 | opacity: 1; 375 | -webkit-transform: scale(1, 1); 376 | transform: scale(1, 1); 377 | -ms-transform: scale(1, 1); } } 378 | 379 | @-webkit-keyframes hidePanel { 380 | 0% { 381 | opacity: 1; 382 | -webkit-transform: scale(1, 1); 383 | transform: scale(1, 1); 384 | -ms-transform: scale(1, 1); } 385 | 100% { 386 | opacity: 0; 387 | -webkit-transform: scale(0, 0); 388 | transform: scale(0, 0); 389 | -ms-transform: scale(0, 0); } } 390 | -------------------------------------------------------------------------------- /dist/css/jquery.datepicker.min.css: -------------------------------------------------------------------------------- 1 | .gmi-date-picker{width:254px;-webkit-transition:all ease-in-out .2s;transition:all ease-in-out .2s}.gmi-date-picker.has-time{width:324px}.gmi-date-picker__header__icon-btn{display:inline-block;width:16px;height:16px;vertical-align:middle;margin:3px 0;float:right;cursor:pointer;color:#475669!important}.gmi-date-picker__header__icon-btn:hover{color:#038cd6}.gmi-date-picker[data-role=year] .gmi-date-picker__header__label--year:hover{color:#475669!important;cursor:default}.gmi-picker-panel{line-height:20px;color:#475669;background-color:#fff;border:1px solid #d3dce6;border-radius:2px;-webkit-box-shadow:0 2px 5px #ccc;box-shadow:0 2px 5px #ccc;margin:5px 0;z-index:2008}.gmi-picker-panel span{color:#475669;font-size:14px;padding:0 3px;cursor:pointer}.gmi-picker-panel span:first-child{padding-left:0}.gmi-picker-panel span:hover{color:#038cd6;text-decoration:none}.gmi-picker-panel__body{width:100%;height:100%}.gmi-picker-panel__body__header{line-height:22px;padding:12px 20px 5px}.gmi-picker-panel__body__header span[class^=gmi-date-picker__header__label--]{color:#475669!important}.gmi-picker-panel__body__header span[class^=gmi-date-picker__header__label--]:hover{color:#038cd6!important}.gmi-picker-panel .gmi-month-picker__header,.gmi-picker-panel .gmi-year-picker__header{padding-bottom:10px}.gmi-picker-panel__body__header--time{padding:8px;border-bottom:1px solid #d3dce6;min-height:30px}.gmi-picker-panel__body__header--time__wrapper{width:50%;float:left;padding:0 5px;-webkit-box-sizing:border-box;box-sizing:border-box}.gmi-picker-panel__body__header--time__wrapper .gmi-input{width:100%;display:inline-block}.gmi-picker-panel__body__header--time__wrapper .gmi-input__inner{width:100%;height:30px;-webkit-appearance:none;-moz-appearance:none;border-radius:2px;border:1px solid #bfcbd9;-webkit-box-sizing:border-box;box-sizing:border-box;color:#1f2d3d;display:block;line-height:1;outline:0;padding:3px 10px;font-size:13px;-webkit-transition:border-color .4s cubic-bezier(.645,.045,.355,1);transition:border-color .4s cubic-bezier(.645,.045,.355,1)}.gmi-picker-panel__body__header--time__wrapper .gmi-input__inner:hover{border:1px solid #038cd6}.gmi-picker-panel__body__header--time__wrapper .gmi-time-picker--wrapper{position:relative;zoom:1}.gmi-picker-panel__btn--prev{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABKElEQVRYR+2W/61BQRCFPxVQgg7o4NEBFXgqoIRXAhWgAjpAB3SghPcqIEdmEjZcuxsvN5KdP++v8805s5PboOZq1KxPASgOFAc+2oEWsLA9MgZ+c3ZKrgNtYA10TfQA9HMgcgAkugXkgDpXyYkTMAQEE12pAKH40pS+DUIxyIloiBQAF9c7EtwEberaDDinQMQCDKxDPd+r6FCQuxSIGAC39++FuBviEE2bEY/p4Vy8AkgVT4aoAnDxI6AINOUppaOqOelUOfEMQMM0ASSuzLOWjB1VzYQgpsA87OARgDIbvUHctbQvHELf9t1xvR8CuPjebM/tPGxUEIrjC7iDuAVw21d2zlPyjn3WG1QUiuTOgR/L7HrjH0uNylnplZ/S4kBxoDhQvwMXBcA9IYMw4zYAAAAASUVORK5CYII=) center center no-repeat;background-size:100% 100%}.gmi-picker-panel__btn--next{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABOElEQVRYR+2U0VHDMBAFNxVAB9ABKSGUQAVABZAO6CBQAVBB6ABKgA4oIVQAszMSI0ywfbEz5kP681i697TvTjMmXrOJ9akGKoFK4F8RuAEOgOWe34ZbYAOo9+Md8McV8ABc7smEtc+BO+C6acDvvOEFOEtOx/ByCKyBBfAIXOSi23ogm3gFTkcwofgzMG+KbyOQjYlnBQw1UYp/Yy+Rtk2BmO6TCeN4D2ZxnLB7c3tKsr9W1xhmE3atcUikz1JU7BL4U7wtglIkaqK3eF8D7rOok/HZQSKLS1bjT124uiIoz5cmxNosrqCNa03HrVdcEQMlCV/MMtsc00dEPBJBk4S3PypeTKclLL6rAc/Z3fbESXL2lm7utIRWNIKyuCbybBtBWHwIgdAt2zYPITCKiWqgEqgEJifwBe9kPSFgrTUbAAAAAElFTkSuQmCC) center center no-repeat;background-size:100% 100%;margin-left:15px}.gmi-picker-panel__body__main{min-width:224px;padding:0 15px 15px}.gmi-picker-panel table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}.gmi-picker-panel .gmi-date-table{font-size:12px!important;min-width:224px;-webkit-user-select:none}.gmi-picker-panel .gmi-date-table th{padding:5px;color:#8492a6;font-size:12px!important;font-weight:400;text-align:center}.gmi-picker-panel .gmi-date-table td{width:32px;height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;cursor:pointer;vertical-align:middle;font-size:12px!important;color:#475669}.gmi-picker-panel .gmi-date-table td.today{color:#038cd6}.gmi-picker-panel .gmi-date-table td.current{background-color:#038cd6;color:#fff}.gmi-picker-panel .gmi-date-table td.disabled{background-color:#f5f5f5;opacity:1;cursor:not-allowed;color:#ddd}.gmi-picker-panel .gmi-date-table td.disabled:hover{background-color:#f5f5f5!important}.gmi-picker-panel .gmi-date-table td.available:not(.current):hover{background-color:#e5e9f2}.gmi-picker-panel .gmi-date-table td.next-month,.gmi-picker-panel .gmi-date-table td.prev-month{color:#ddd}.gmi-picker-panel .gmi-date-table td.in-range{background-color:#c2dcef}.gmi-picker-panel .gmi-date-table td.in-range:hover{background-color:#c2dcef!important}.gmi-picker-panel .gmi-date-table td.end-date,.gmi-picker-panel .gmi-date-table td.start-date{background-color:#038cd6;color:#fff}.gmi-picker-panel .gmi-date-table td.end-date:hover,.gmi-picker-panel .gmi-date-table td.start-date:hover{background-color:#038cd6!important}.gmi-picker-panel .gmi-month-table,.gmi-picker-panel .gmi-year-table{font-size:12px!important;min-width:224px;-webkit-user-select:none}.gmi-picker-panel .gmi-month-table td,.gmi-picker-panel .gmi-year-table td{padding:22px 3px;vertical-align:middle}.gmi-picker-panel .gmi-month-table td .cell,.gmi-picker-panel .gmi-year-table td .cell{height:32px;display:block;line-height:32px;text-align:center;cursor:pointer;font-size:12px!important;color:#475669!important}.gmi-picker-panel .gmi-month-table td .cell:not(.current):hover,.gmi-picker-panel .gmi-year-table td .cell:not(.current):hover{background-color:#e5e9f2}.gmi-picker-panel .gmi-month-table td.current .cell,.gmi-picker-panel .gmi-year-table td.current .cell{background-color:#038cd6!important;color:#fff!important}.gmi-picker-panel .gmi-month-table td.disabled .cell,.gmi-picker-panel .gmi-year-table td.disabled .cell{background-color:#f5f5f5;opacity:1;cursor:not-allowed;color:#ddd!important}.gmi-picker-panel .gmi-month-table td.disabled .cell:hover,.gmi-picker-panel .gmi-year-table td.disabled .cell:hover{background-color:#f5f5f5!important}.gmi-picker-panel__footer{padding:0 8px;border-top:1px solid #d3dce6;text-align:right;background-color:#fff}.gmi-picker-panel__footer .gmi-picker-panel__link-btn{display:inline-block;color:#038cd6;padding:10px 5px}.gmi-picker-panel__footer .gmi-picker-panel__link-btn--default{color:#8391a5}.gmi-picker-panel__footer .gmi-picker-panel__link-btn--primary{color:#038cd6}.gmi-picker-panel__footer .gmi-picker-panel__link-btn:hover{text-decoration:none}.gmi-picker-panel__footer .gmi-picker-panel__link-btn.disabled{color:#ccc;cursor:not-allowed}.gmi-picker-panel.placement-left-bottom{-ms-transform-origin:0 bottom!important;-webkit-transform-origin:0 bottom!important;transform-origin:0 bottom!important}.gmi-picker-panel.placement-center-bottom{-ms-transform-origin:50% bottom!important;-webkit-transform-origin:50% bottom!important;transform-origin:50% bottom!important}.gmi-picker-panel.placement-right-bottom{-ms-transform-origin:100% bottom!important;-webkit-transform-origin:100% bottom!important;transform-origin:100% bottom!important}.gmi-date-range-picker{width:520px;-webkit-transition:all ease-in-out .2s;transition:all ease-in-out .2s}.gmi-date-range-picker.has-time{width:660px}.gmi-date-range-picker__body{clear:both;overflow:hidden}.gmi-date-range-picker__body__header{font-size:14px;text-align:center;position:relative;padding-bottom:5px}.gmi-date-range-picker__body .gmi-picker-panel__body__main{width:50%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:15px}.gmi-date-range-picker__header--time__wrapper .gmi-input{float:left;width:50%;padding:0 5px;-webkit-box-sizing:border-box;box-sizing:border-box}.gmi-date-range-picker__header__icon-btn{position:absolute;top:0;cursor:pointer;width:16px;height:16px}.gmi-date-range-picker__header__icon-btn:hover{color:#038cd6}.gmi-date-range-picker__btn--prev{left:5px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABHklEQVRYR8XXuw3CMBCA4TsaRAWjwAYYJqBBpCNlYB6UEqiQ2AElI2QERmCCGBkUkSiJ48edoaEx/J8iRb5DIPikt2yZRCI3+avTPZurc8etKNQ3mvxIdya9PfaAeAaQl2S3jnVnVRxLmX3CEhdJJJ5egF8cAKSMk2h96QNUcQSYSQnXQ7Taez0BirgzgCruBKCMWwOo41YAjrgxgCtuBOCMDwK441pAiHgvIFS8ExAy3gKEjjcA/4h7AUZlmQPgVAIUkzGKeCNeLld74zq2fQoUiNY8EBrROZCERPRORKEQ2pEsBGJwJuRGDALUq8WJMAJwIowBXAgrAAfCGkCNcAJQIpwBVAgvQB1R3/d0++H3AlO75GjuvZxWIZ/1/A1dhe0wdsJuuwAAAABJRU5ErkJggg==) center center no-repeat;background-size:100% 100%}.gmi-date-range-picker__btn--prev-month{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAr0lEQVRYR8XVsRECMQxEUbk1aAIiIISCiI+ILmjNzAWkjFb6O3YD/8nJjlj8xuJ+WADP92cbIy5zxutxPlz/HYkDlPgOQwFqHAVU4higGkcAnXgb0I23AES8DKDiJQAZlwF0XAI44mmAK54COOMSIGJu99PxRs93aox+v+BApAD71S5EGuBCSAAHQgbQiBKARJQBFKIFIBBtQBeBADoIDFBFoIAKAgeoCAtAWczlgC8d87YhVW+y5wAAAABJRU5ErkJggg==) center center no-repeat;background-size:100% 100%;left:25px}.gmi-date-range-picker__btn--next{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABLUlEQVRYR8XXsRGCMBQG4PdcQEbQCXQDT1kCKrWESodRSrHizsYJFDbRLdQmzyOcHByKeWgSGpq8+z9S5CcIlh/M86PktMjfge/GHM/mkI5RiHnouWvOXHUt7o6pc3+IKwD2gWjJQWyTc4YIEwCKA89ddkHIHci/pCdExkUUeMoAYNQVIQE2ESXAFqIGsIFoAEwj3gJMIj4CTCFaASYQXwG6EUoAnQhlgC4EC6ADwQaU7Ym4k2c44TDwp1eVIoqSdABIl2KuKD42oKhgShHA4bRnXly3h5wbE8E+9GfyF4AF+Hc4C6AjXBmgK1wJoDP8K0B3eCvARPhHgKnwtwCT4Q2A6fAawEZ4CbAVLgH/uBlVz3aVUqqu+flu2BNiEXjuihv8Ws8qo64hbXPWAU9Lh/8w7QLSzwAAAABJRU5ErkJggg==) center center no-repeat;background-size:100% 100%;right:5px}.gmi-date-range-picker__btn--next-month{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAx0lEQVRYR8XXvQ3CMBBA4fMGjITCElCFlDBQ2oQqZTaAtaAySkGL7+ed4t5+n1z45CI7r7JzX5qAcXnOpUgvUufb+TTQ4CZgC2YiVIBMhBqQhTABMhBmAI1wAUiEG0AhQgACEQZEEQgggsAAXgQK8CBwgBWRCqhVHvdLd/03QXHAb3Jq4hsMBVjjKMATxwDeOAKIxMOAaDwEIOJuABV3Aci4GUDHTYCMuBqQFW8CpvV1eH/qKiJH7dtu/bqhs8Aab96A50Drni+AWrkh0KGJCQAAAABJRU5ErkJggg==) center center no-repeat;background-size:100% 100%;right:25px}.gmi-date-range-picker .f-lt{float:left;border-right:1px solid #d3dce6}.gmi-date-range-picker .f-rt{float:right}.gmi-time-panel{margin:5px 0;color:#475669;background-color:#fff;border:1px solid #d1dbe5;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);border-radius:2px;-webkit-transform-origin:center top 0;-ms-transform-origin:center top 0;transform-origin:center top 0;z-index:2011;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.gmi-time-panel__body{width:100%;height:100%;position:relative;overflow:hidden}.gmi-time-panel__body:after,.gmi-time-panel__body:before{content:":";top:50%;position:absolute;font-size:14px;line-height:16px;background-color:#039cef;height:32px;right:0;padding-top:6px;text-align:left;color:#fff}.gmi-time-panel__body:before{padding-left:33.33333%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);left:0;-webkit-box-sizing:border-box;box-sizing:border-box}.gmi-time-panel__body:after{-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);left:66.66667%;-webkit-box-sizing:border-box;box-sizing:border-box}.gmi-time-panel__body__item{width:33.33%;height:100%;overflow:hidden;position:relative;z-index:1;float:left;text-align:center}.gmi-time-panel__body__item--spinner{width:100%;max-height:192px}.gmi-time-panel__body__item--spinner:after,.gmi-time-panel__body__item--spinner:before{content:" ";display:block;width:100%;height:80px}.gmi-time-panel__body__item--spinner__item{height:32px;line-height:32px;font-size:12px;cursor:pointer}.gmi-time-panel__body__item--spinner__item.active{color:#fff}.gmi-time-panel__body__item--spinner__item.active:hover{cursor:default}.gmi-time-panel__body__item--spinner__item.disabled{color:#cecece;cursor:not-allowed}.picker-show{animation:showPanel .2s ease-in-out;-webkit-animation:showPanel .2s ease-in-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.picker-hide{animation:hidePanel .2s ease-in-out;-webkit-animation:hidePanel .2s ease-in-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes showPanel{0%{opacity:0;-webkit-transform:scale(0,0);transform:scale(0,0);-ms-transform:scale(0,0)}100%{opacity:1;-webkit-transform:scale(1,1);transform:scale(1,1);-ms-transform:scale(1,1)}}@-webkit-keyframes hidePanel{0%{opacity:1;-webkit-transform:scale(1,1);transform:scale(1,1);-ms-transform:scale(1,1)}100%{opacity:0;-webkit-transform:scale(0,0);transform:scale(0,0);-ms-transform:scale(0,0)}} -------------------------------------------------------------------------------- /dist/examples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Guideline 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

Gemini DatePicker

17 |
18 |
19 |
20 |
21 |

Guideline

22 | 30 |
31 |
32 | 45 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /dist/i18n/datepicker.en-US.js: -------------------------------------------------------------------------------- 1 | (function (factory, jQuery) { 2 | if (typeof define === 'function' && define.amd) { 3 | define('datepicker.en-US', ['jquery'], factory); 4 | } else if (typeof exports === 'object') { 5 | factory(require('jquery')); 6 | } else { 7 | factory(jQuery); 8 | } 9 | })(function ($) { 10 | $.fn.datepicker.lang['en-US'] = { 11 | days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], 12 | daysMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 13 | months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 14 | monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 15 | yearSuffix: '', 16 | monthSuffix: '', 17 | todaySuffix: 'Today', 18 | dateInputPlaceholder: 'Select date', 19 | rangeStartInputPlaceholder: 'Start Date', 20 | rangeEndPlaceholder: 'End Date', 21 | dateTimeInputPlaceholder: 'Select time', 22 | rangeStartTimeInputPlaceholder: 'Start Time', 23 | rangeEndTimeInputPlaceholder: 'End Time', 24 | nowDateButton: 'Now', 25 | confirmDateButton: 'Confirm', 26 | cancelTimeButton: 'Cancel', 27 | clearButton: 'Clear' 28 | }; 29 | }, window.jQuery); 30 | -------------------------------------------------------------------------------- /dist/i18n/datepicker.ru-RU.js: -------------------------------------------------------------------------------- 1 | (function (factory, jQuery) { 2 | if (typeof define === 'function' && define.amd) { 3 | define('datepicker.ru-RU', ['jquery'], factory); 4 | } else if (typeof exports === 'object') { 5 | factory(require('jquery')); 6 | } else { 7 | factory(jQuery); 8 | } 9 | })(function ($) { 10 | $.fn.datepicker.lang['ru-RU'] = { 11 | days: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'], 12 | daysMin: ['ВС', 'ПН', 'ВТ', 'СР', 'ЧТ', 'ПТ', 'СБ'], 13 | months: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'], 14 | monthsShort: ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июнь', 'Июль', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'], 15 | yearSuffix: '', 16 | monthSuffix: '', 17 | todaySuffix: 'Сегодня', 18 | dateInputPlaceholder: 'Выберите дату', 19 | rangeStartInputPlaceholder: 'Начальная дата', 20 | rangeEndPlaceholder: 'Конечная дата', 21 | dateTimeInputPlaceholder: 'Выберите время', 22 | rangeStartTimeInputPlaceholder: 'Начальное время', 23 | rangeEndTimeInputPlaceholder: 'Конечное время', 24 | nowDateButton: 'Сейчас', 25 | confirmDateButton: 'Подтвердить', 26 | cancelTimeButton: 'Отмена', 27 | clearButton: 'Очистить' 28 | }; 29 | }, window.jQuery); 30 | -------------------------------------------------------------------------------- /dist/i18n/datepicker.vi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Greg Zhang. 3 | */ 4 | (function (factory, jQuery) { 5 | if (typeof define === 'function' && define.amd) { 6 | define('datepicker.vi', ['jquery'], factory); 7 | } else if (typeof exports === 'object') { 8 | factory(require('jquery')); 9 | } else { 10 | factory(jQuery); 11 | } 12 | })(function ($) { 13 | $.fn.datepicker.lang['vi'] = { 14 | days: ["Chủ Nhật","Thứ 2", "Thứ 3", "Thứ 4", "Thứ 5", "Thứ 6", "Thứ 7", "Chủ Nhật"], 15 | daysMin: ["CN", "T2", "T3", "T4", "T5", "T6", "T7", "CN"], 16 | months: ["Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12"], 17 | monthsShort: ["Thg1", "Thg2", "Thg3", "Thg4", "Thg5", "Thg6", "Thg7", "Thg8", "Thg9", "Thg10", "Thg11", "Thg12"], 18 | yearSuffix: '', 19 | monthSuffix: '', 20 | todaySuffix: 'Hôm nay', 21 | dateInputPlaceholder: 'tuyển chọn ngày tháng', 22 | rangeStartInputPlaceholder: 'bắt đầu công việc ngày tháng', 23 | rangeEndPlaceholder: 'cuối cùng ngày tháng', 24 | dateTimeInputPlaceholder: 'tuyển chọn thời điểm', 25 | rangeStartTimeInputPlaceholder: 'bắt đầu công việc thời điểm', 26 | rangeEndTimeInputPlaceholder: 'cuối cùng thời điểm', 27 | nowDateButton: 'hiện nay', 28 | confirmDateButton: 'quyết định', 29 | cancelTimeButton: 'hủy bỏ', 30 | clearButton: 'trong suốt' 31 | }; 32 | }, window.jQuery); 33 | -------------------------------------------------------------------------------- /dist/i18n/datepicker.zh-CN.js: -------------------------------------------------------------------------------- 1 | (function (factory, jQuery) { 2 | if (typeof define === 'function' && define.amd) { 3 | define('datepicker.zh-CN', ['jquery'], factory); 4 | } else if (typeof exports === 'object') { 5 | factory(require('jquery')); 6 | } else { 7 | factory(jQuery); 8 | } 9 | })(function ($) { 10 | $.fn.datepicker.lang['zh-CN'] = { 11 | days: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 12 | daysShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], 13 | daysMin: ['日', '一', '二', '三', '四', '五', '六'], 14 | months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 15 | monthsShort: ['1 月', '2 月', '3 月', '4 月', '5 月', '6 月', '7 月', '8 月', '9 月', '10 月', '11 月', '12 月'], 16 | yearSuffix: '年', 17 | monthSuffix: '月', 18 | todaySuffix: '今天', 19 | dateInputPlaceholder: '当前日期', 20 | rangeStartInputPlaceholder: '开始日期', 21 | rangeEndPlaceholder: '结束日期', 22 | dateTimeInputPlaceholder: '当前时间', 23 | rangeStartTimeInputPlaceholder: '开始时间', 24 | rangeEndTimeInputPlaceholder: '结束时间', 25 | nowDateButton: '此刻', 26 | confirmDateButton: '确定', 27 | cancelTimeButton: '取消', 28 | clearButton: '清空' 29 | }; 30 | }, window.jQuery); 31 | -------------------------------------------------------------------------------- /dist/js/jquery.datepicker.min.js: -------------------------------------------------------------------------------- 1 | !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){"use strict";function t(e,t){var a=[];return Array.from?Array.from(e).slice(t||0):("number"!=typeof t||isNaN(t)||a.push(t),a.slice.apply(e,a))}function a(e){return"string"==typeof e}function n(e){return"object"==typeof e&&e instanceof Date}function r(a,n,r){a.removeClass(n).addClass(n).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){e(this).removeClass(n),r.apply(a,t(arguments))}),d&&s<=9&&(a.removeClass(n),r.apply(a,t(arguments)))}var i=function(){function e(e,t){for(var a=[],n=0,r=e.length;n3?0:(e-e%10!=10)*e%10]}};var p={D:function(e){return e.getDay()},DD:function(e){return a(e.getDay())},Do:function(e,t){return t.DoFn(e.getDate())},d:function(e){return e.getDate()},dd:function(e){return a(e.getDate())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return e.getMonth()+1},MM:function(e){return a(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},yy:function(e){return String(e.getFullYear()).substr(2)},yyyy:function(e){return e.getFullYear()},h:function(e){return e.getHours()%12||12},hh:function(e){return a(e.getHours()%12||12)},H:function(e){return e.getHours()},HH:function(e){return a(e.getHours())},m:function(e){return e.getMinutes()},mm:function(e){return a(e.getMinutes())},s:function(e){return e.getSeconds()},ss:function(e){return a(e.getSeconds())},S:function(e){return Math.round(e.getMilliseconds()/100)},SS:function(e){return a(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return a(e.getMilliseconds(),3)},a:function(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+a(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)}},f={d:[i,function(e,t){e.day=t}],M:[i,function(e,t){e.month=t-1}],yy:[i,function(e,t){var a=new Date,n=+(""+a.getFullYear()).substr(0,2);e.year=""+(t>68?n-1:n)+t}],h:[i,function(e,t){e.hour=t}],m:[i,function(e,t){e.minute=t}],s:[i,function(e,t){e.second=t}],yyyy:[o,function(e,t){e.year=t}],S:[/\d/,function(e,t){e.millisecond=100*t}],SS:[/\d{2}/,function(e,t){e.millisecond=10*t}],SSS:[l,function(e,t){e.millisecond=t}],D:[i,s],ddd:[d,s],MMM:[d,t("monthNamesShort")],MMMM:[d,t("monthNames")],a:[d,function(e,t,a){var n=t.toLowerCase();n===a.amPm[0]?e.isPm=!1:n===a.amPm[1]&&(e.isPm=!0)}],ZZ:[/[\+\-]\d\d:?\d\d/,function(e,t){var a,n=(t+"").match(/([\+\-]|\d\d)/gi);n&&(a=60*n[1]+parseInt(n[2],10),e.timezoneOffset="+"===n[0]?a:-a)}]};return f.DD=f.DD,f.dddd=f.ddd,f.Do=f.dd=f.d,f.mm=f.m,f.hh=f.H=f.HH=f.h,f.MM=f.M,f.ss=f.s,f.A=f.a,n.masks={default:"ddd MMM dd yyyy HH:mm:ss",shortDate:"M/D/yy",mediumDate:"MMM d, yyyy",longDate:"MMMM d, yyyy",fullDate:"dddd, MMMM d, yyyy",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},n.format=function(e,t,a){var i=a||n.i18n;if("number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date in fecha.format");return t=n.masks[t]||t||n.masks.default,t.replace(r,function(t){return t in p?p[t](e,i):t.slice(1,t.length-1)})},n.parse=function(e,t,a){var i=a||n.i18n;if("string"!=typeof t)throw new Error("Invalid format in fecha.parse");if(t=n.masks[t]||t,e.length>1e3)return!1;var l=!0,o={};if(t.replace(r,function(t){if(f[t]){var a=f[t],n=e.search(a[0]);~n?e.replace(a[0],function(t){return a[1](o,t,i),e=e.substr(n+t.length),t}):l=!1}return f[t]?"":t.slice(1,t.length-1)}),!l)return!1;var d=new Date;!0===o.isPm&&null!=o.hour&&12!=+o.hour?o.hour=+o.hour+12:!1===o.isPm&&12==+o.hour&&(o.hour=0);var s;return null!=o.timezoneOffset?(o.minute=+(o.minute||0)-+o.timezoneOffset,s=new Date(Date.UTC(o.year||d.getFullYear(),o.month||0,o.day||1,o.hour||0,o.minute||0,o.second||0,o.millisecond||0))):s=new Date(o.year||d.getFullYear(),o.month||0,o.day||1,o.hour||0,o.minute||0,o.second||0,o.millisecond||0),s},n}(),l="undefined"!=typeof window,o=l&&window.navigator.userAgent.toLowerCase(),d=o&&/msie|trident/.test(o),s=document.documentMode,m=function(t,i){var l=this,o={defaults:{readonly:!1,disabled:!1,type:"date",format:"yyyy-MM-dd",placeholder:"Please pick a day",align:"left",startDate:null,endDate:null,lang:"en-US",rangeSeparator:"-",weekStart:0,defaultValue:"",zIndex:2008,onChange:null,onShow:null,onHide:null},_init:function(){l=e.extend(!0,l,o.defaults,i||{}),l.lang&&(l=e.extend(l,e.fn.datepicker.lang[l.lang]));var a=l.type;"datetime"!==a&&"datetime-range"!==a||l.format!==o.defaults.format?"year"===a?l.format="yyyy":"month"===a&&l.format===o.defaults.format&&(l.format="yyyy-MM"):l.format="yyyy-MM-dd HH:mm:ss",l.date=new Date,l.value="",l.yearLabel=l.date.getFullYear(),l.monthLabel=l.date.getMonth(),l.readonly&&t.attr("readonly",!0),l.disabled&&t.attr("disabled",!0),l.placeholder&&t.attr("placeholder",l.placeholder),o._created()},_created:function(){var a,n=l.type,r=l.align,i=l.zIndex,m="center"===r?"50%":"right"===r?"100%":"0",c=e("body");if("date"===n||"month"===n||"year"===n||"datetime"===n?("date"===n||"datetime"===n?l.currentView="dateView":"year"===n?l.currentView="yearView":"month"===n&&(l.currentView="monthView"),a=o._generateDateDOM()):"date-range"!==n&&"datetime-range"!==n||(a=o._generateRangeDateDOM()),l.$pickerPanel=e(a).appendTo(c).css({position:"absolute",zIndex:parseInt(i,10)}),(!d||d&&s>9)&&l.$pickerPanel.css({transformOrigin:m+" 0",msTransformOrigin:m+" 0"}),l.$pickerPanel.find(".gmi-time-panel").length>0){var u=l.$pickerPanel.find(".gmi-time-panel");u.css({width:"154px",position:"absolute",left:0,zIndex:2009}),l.$timePanel=u}switch(e.isFunction(l.onChange)&&t.on("pick.datepicker",l.onChange),o._setDate(l.defaultValue),n){case"date":case"datetime":l.$pickerPanel.find(".gmi-date-table").show().siblings().hide();break;case"year":l.$pickerPanel.find(".gmi-year-table").show().siblings().hide();break;case"month":l.$pickerPanel.find(".gmi-month-table").show().siblings().hide()}o._echoDateOrTimeIntoInput(),o._bindEvent()},_unCreate:function(){var e=l.$pickerPanel;e&&e.length>0&&e.remove()},_bindEvent:function(){e(document).on("click.datepicker",function(a){var n=e(a.target);!n.is(t)&&t.has(n).length<=0&&o._hidePickerPanel()}),e(window).on("resize.datepicker",function(){o._setDatePanelPosition()}).on("scroll.datepicker",function(){o._setDatePanelPosition()}),t.on("focus.datepicker",o._elFocusHandler).on("click.datepicker",o._elClickHandler).on("change.datepicker",o._elChangeHandler).on("keyup.datepicker",o._elKeyUpHandler),e.isFunction(l.onShow)&&t.on("show.datepicker",l.onShow),e.isFunction(l.onHide)&&t.on("show.datepicker",l.onHide),l.$pickerPanel.on("click.datepicker",function(e){e.stopPropagation()}),l.$pickerPanel.on("focus.datepicker",".gmi-time-picker--input",function(t){var a=e(this);o._setTimeView(a,t)}).on("keyup.datepicker",".gmi-time-picker--input",function(t){var a=e(this);o._setTimeView(a,t)}).on("change.datepicker",".gmi-time-picker--input",function(t){var a=e(this);o._setTimeView(a,t)}),l.$timePanel&&l.$timePanel.length>0&&(l.$timePanel.on("mouseenter.datepicker",".gmi-time-panel__body__item",function(t){var a=e(this),n=a.find("> ul.gmi-time-panel__body__item--spinner");a.css("overflow","auto"),n.css("width","100%")}).on("mouseleave.datepicker",".gmi-time-panel__body__item",function(t){var a=e(this),n=a.find("> ul.gmi-time-panel__body__item--spinner"),r=a.outerWidth();a.css("overflow","hidden"),n.css("width",r+"px")}),l.$timePanel.on("click.datepicker",".gmi-time-panel__body__item--spinner__item:not(.disabled)",function(t){var a=e(this),n=a.parents(".gmi-time-panel__body__item").eq(0),r=(a.parents(".gmi-time-panel__body__item--spinner").data("role"),Number(a.text())),i=a.outerHeight(),l=r*i;a.addClass("active").siblings().removeClass("active"),n.scrollTop(l),t.stopPropagation()}),l.$timePanel.on("click.datepicker",".gmi-time-panel__btn",function(t){var a=e(this),n=a.data("role"),r=new Date,i=e(t.delegateTarget),o=i.siblings(".gmi-time-picker--input"),d=i.find('.gmi-time-panel__body__item--spinner[data-role="hour"]'),s=i.find('.gmi-time-panel__body__item--spinner[data-role="min"]'),m=i.find('.gmi-time-panel__body__item--spinner[data-role="sec"]'),c=Number(d.find("> li.active").text()),u=Number(s.find("> li.active").text()),g=Number(m.find("> li.active").text());switch(r.setHours(c,u,g,0),n){case"confirm":o.val(e.formatDate(r,"HH:mm:ss")),i.hide();var p=l.$pickerPanel.find(".gmi-time-picker--input").filter(function(){return""===e(this).val()||!e.parseDate(e(this).val(),"HH:mm:ss")});p&&0===p.length&&l.$pickerPanel.find(".gmi-picker-panel__link-btn--determine").removeClass("disabled");break;case"cancel":i.hide()}})),l.$pickerPanel.on("click.datepicker","td:not(.disabled)",function(t){var a,n,r=l.type,i=l.format,d=e(t.delegateTarget),s=d.find(".gmi-picker-panel__link-btn--determine"),m=e(this);if(t.stopPropagation(),"date"===r||"datetime"===r){var c,u,g=l.currentView;if("dateView"===g){var p=m.text()===l.todaySuffix?(new Date).getDate():Number(m.text());if(m.hasClass("prev-month")||m.hasClass("next-month")?(m.hasClass("prev-month")?(c=l.monthLabel-1<0?l.yearLabel-1:l.yearLabel,u=l.monthLabel-1<0?11:l.monthLabel-1):m.hasClass("next-month")&&(c=l.monthLabel+1>11?l.yearLabel+1:l.yearLabel,u=l.monthLabel+1>11?0:l.monthLabel+1),"date"===r?(n=e.formatDate(new Date(c,u,p),i),o._setDate(n)):(n=e.formatDate(new Date(c,u,p)),o._setNewDateDOM(d,c,u,p),d.find(".gmi-date-table td").removeClass("current").filter(function(){return Number(e(this).data("year"))===c&&Number(e(this).data("month"))===u&&Number(e(this).text())===p}).addClass("current"),l.yearLabel=c,l.monthLabel=u)):(c=l.yearLabel,u=l.monthLabel,"date"===r?(n=e.formatDate(new Date(c,u,p),i),o._setDate(n)):(n=e.formatDate(new Date(c,u,p)),d.find(".gmi-date-table").find("td").removeClass("current"),m.addClass("current"))),"datetime"===r)return d.find(".gmi-date-picker--input").val(n),a=d.find(".gmi-time-picker--input"),""!==a.val()&&e.parseDate(a.val(),"HH:mm:ss")||a.val("00:00:00"),s.removeClass("disabled"),!1;o._hidePickerPanel()}else"yearView"===g?o._setYearView(m):o._setMonthView(m)}else if("month"===r)switch(l.currentView){case"monthView":o._setMonthView(m);break;case"yearView":o._setYearView(m)}else if("year"===r)o._setYearView(m);else if("date-range"===r||"datetime-range"===r){var f,h=l.minDate,_=l.maxDate,D=d.find('.gmi-date-picker--input[data-role="range-start"]'),y=d.find('.gmi-time-picker--input[data-role="range-start"]'),b=d.find('.gmi-date-picker--input[data-role="range-end"]'),v=d.find('.gmi-time-picker--input[data-role="range-end"]');c=Number(m.data("year")),u=Number(m.data("month")),p=m.text()===l.todaySuffix?(new Date).getDate():Number(m.text()),h&&_?(l.minDate=new Date(c,u,p),l.maxDate=null,d.find(".gmi-date-table td").removeClass("start-date in-range end-date"),m.hasClass("prev-month")||m.hasClass("next-month")||m.addClass("start-date in-range"),"datetime-range"===r&&(D.val(e.formatDate(l.minDate)),s.addClass("disabled"))):h&&!_?new Date(c,u,p).getTime()l.minDate.getTime()&&i.getTime()=s.getTime()&&(a.find(".gmi-date-table td").filter(function(){var t=Number(e(this).data("year")),a=Number(e(this).data("month")),n=e(this).text()===l.todaySuffix?(new Date).getDate():Number(e(this).text());return!e(this).hasClass("prev-month")&&!e(this).hasClass("next-month")&&new Date(t,a,n).getTime()>s.getTime()&&new Date(t,a,n).getTime()