├── .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 | ##  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 | 
16 | ##### Type: month
17 | 
18 | ##### Type: year
19 | 
20 | ##### Type: datetime
21 | 
22 | ##### Type: date-range
23 | 
24 | ##### Type: datetime-range
25 | 
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 |
19 |
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()'+a+'
"+("date"===e||"datetime"===e?'":"")+'
'+o._getDateTable(l.date)+o._getYearTable(l.date.getFullYear())+o._getMonthTable(l.date.getMonth())+"
"+n+""},_generateRangeDateDOM:function(){var t=l.date,a=l.minDate?l.minDate:t,n=l.minDate?e.getNextMonth(l.minDate):e.getNextMonth(t),r=l.type,i="datetime-range"===r?"has-time":"",d="datetime-range"===r?o._generateRangeDatetimeHeader():"",s="datetime-range"===r?o._generateDatetimeFooter(r):"";return''+d+'
'+a.getFullYear()+" "+l.yearSuffix+" "+l.monthsShort[a.getMonth()]+'
'+o._getDateTable(a)+'
'+n.getFullYear()+" "+l.yearSuffix+" "+l.monthsShort[n.getMonth()]+'
'+o._getDateTable(n)+"
"+s+"
"},_generateDatetimeHeader:function(){return'"},_generateRangeDatetimeHeader:function(){return'"},_generateDatetimeFooter:function(e){var t="datetime-range"===e?l.clearButton:l.nowDateButton,a="datetime-range"===e?"gmi-picker-panel__link-btn--clear":"gmi-picker-panel__link-btn--now";return'"},_generateTimePickerDOM:function(e){return''+o._getTimeSpinner("hour")+'
'+o._getTimeSpinner("min")+'
'+o._getTimeSpinner("sec")+'
"},_getDateRows:function(t){var a=[[],[],[],[],[],[]],r=t.getFullYear(),i=t.getMonth(),o=new Date(r,i,1),d=e.getFirstDayOfMonth(o),s=e.getTotalDayCountOfMonth(o.getFullYear(),o.getMonth()),m=e.getTotalDayCountOfMonth(o.getFullYear(),0===o.getMonth()?11:o.getMonth()-1);d=0===d?7:d;for(var c,u=-1*l.weekStart,g=a,p=1,f=e.getStartDateOfMonth(r,i),h=e.clearHours(new Date),_=0;_<6;_++)for(var D=g[_],y=0;y<7;y++){var b=D[y];b||(b={row:_,column:y,type:"normal",year:o.getFullYear(),month:o.getMonth(),inRange:!1,start:!1,end:!1}),b.type="normal";var v=7*_+y,k=f.getTime()+864e5*(v-u);b.inRange=k>=e.clearHours(l.minDate)&&k<=e.clearHours(l.maxDate),b.start=l.minDate&&k===e.clearHours(l.minDate),b.end=l.maxDate&&k===e.clearHours(l.maxDate),b.disabled=!1,l.startDate&&n(l.startDate)&&ke.clearHours(l.endDate)&&(b.disabled=!0);var w=k===h;w&&(b.type="today"),_>=0&&_<=1?y+7*_>=d+u?(b.text=p++,2===p&&(c=7*_+y),b.year=o.getFullYear(),b.month=o.getMonth()):(b.text=m-(d+u-y%7)+1+7*_,b.type="prev-month",b.year=0===o.getMonth()?o.getFullYear()-1:o.getFullYear(),b.month=0===o.getMonth()?11:o.getMonth()-1):p<=s?(b.text=p++,2===p&&(c=7*_+y),b.year=o.getFullYear(),b.month=o.getMonth()):(b.text=p++-s,b.type="next-month",b.year=11===o.getMonth()?o.getFullYear()+1:o.getFullYear(),b.month=11===o.getMonth()?0:o.getMonth()+1),D[y]=e.extend({},b)}return g.firstDayPosition=c,g},_getWeekDayRows:function(){var e=l.daysMin;return l.weekStart&&(e=e.slice(l.weekStart).concat(e.slice(0,l.weekStart))),e},_getYearRows:function(e){for(var t=10*Math.floor(e/10),a=[[],[],[]],n=0;n<3;n++)for(var r=a[n],i=0;i<4;i++){var l=4*n+i;if(l>9)break;r[i]=t+l}return a},_getMonthRows:function(){for(var e=[[],[],[]],t=l.monthsShort,a=0,n=0;n";i+="";for(var d=0;d"+a[d]+"";i+="
";for(var s=0;s';for(var c=0;c'+p+""}i+=""}return i+=""},_getYearTable:function(e){for(var t=o._getYearRows(e),a=l.startDate&&n(l.startDate)?l.startDate.getFullYear():null,r=l.endDate&&n(l.endDate)?l.endDate.getFullYear():null,i='',d=0;d";for(var m=0;mr&&(u=!0);var g=u?"disabled":"";i+=''+c+" | "}i+=""}return i+="
"},_getMonthTable:function(e){for(var t=o._getMonthRows(),a=l.startDate&&n(l.startDate)?l.startDate.getFullYear():null,r=l.startDate&&n(l.startDate)?l.startDate.getMonth():null,i=a&&r?new Date(a,r,1).getTime():null,d=l.endDate&&n(l.endDate)?l.endDate.getFullYear():null,s=l.endDate&&n(l.endDate)?l.endDate.getMonth():null,m=d&&s?new Date(d,s,1).getTime():null,c='',u=0;u";for(var p=0;pm&&(h=!0);var _=h?"disabled":"",D=e!==4*u+p||h?"":"current";c+=''+f+" | "}c+=""}return c+="
"},_getTimeSpinner:function(e){for(var t=o._getTimeSpinnerData(e),a='',n=0;n'+t[n]+"";return a+="
"},_echoDateOrTimeIntoInput:function(){var t=l.type;if("datetime"===t){var a=l.$pickerPanel.find(".gmi-date-picker--input"),n=l.$pickerPanel.find(".gmi-time-picker--input"),r=e.formatDate(l.date),i=e.formatDate(l.date,"HH:mm:ss");a.val(r),n.val(i)}else if("datetime-range"===t){var o,d,s,m,c=l.$pickerPanel.find(".gmi-date-picker--input").filter('[data-role="range-start"]'),u=l.$pickerPanel.find(".gmi-date-picker--input").filter('[data-role="range-end"]'),g=l.$pickerPanel.find(".gmi-time-picker--input").filter('[data-role="range-start"]'),p=l.$pickerPanel.find(".gmi-time-picker--input").filter('[data-role="range-end"]');l.minDate&&l.maxDate?(o=e.formatDate(l.minDate),d=e.formatDate(l.minDate,"HH:mm:ss"),s=e.formatDate(l.maxDate),m=e.formatDate(l.maxDate,"HH:mm:ss"),c.val(o),g.val(d),u.val(s),p.val(m)):(o=e.formatDate(l.date),d=e.formatDate(l.date,"HH:mm:ss"),s=e.formatDate(l.date),m=e.formatDate(l.date,"HH:mm:ss"),c.val(o),g.val(d),u.val(s),p.val(m))}},_echoTimeIntoSpinner:function(t,a){var n=l.type;if("datetime"===n){var r=t&&"object"==typeof t?t.hour:l.date.getHours(),i=t&&"object"==typeof t?t.min:l.date.getMinutes(),o=t&&"object"==typeof t?t.sec:l.date.getSeconds(),d=l.$timePanel.find(".gmi-time-panel__body__item--spinner[data-role=hour]"),s=l.$timePanel.find(".gmi-time-panel__body__item--spinner[data-role=min]"),m=l.$timePanel.find(".gmi-time-panel__body__item--spinner[data-role=sec]"),c=d.children("li").filter(function(){return Number(e(this).text())===r}),u=s.children("li").filter(function(){return Number(e(this).text())===i}),g=m.children("li").filter(function(){return Number(e(this).text())===o}),p=c.outerHeight();if(l.$timePanel.show(),!(c.length>0&&u.length>0&&g.length>0))return;c.addClass("active").siblings().removeClass("active"),u.addClass("active").siblings().removeClass("active"),g.addClass("active").siblings().removeClass("active"),d.parent().scrollTop(r*p),s.parent().scrollTop(i*p),m.parent().scrollTop(o*p)}else if("datetime-range"===n)if("range-start"===a){var f=t&&"object"==typeof t?t.minHour:l.minDate?l.minDate.getHours():l.date.getHours(),h=t&&"object"==typeof t?t.minMin:l.minDate?l.minDate.getMinutes():l.date.getMinutes(),_=t&&"object"==typeof t?t.minSec:l.minDate?l.minDate.getSeconds():l.date.getSeconds(),D=l.$timePanel.filter('[data-role="range-start"]').find(".gmi-time-panel__body__item--spinner[data-role=hour]"),y=l.$timePanel.filter('[data-role="range-start"]').find(".gmi-time-panel__body__item--spinner[data-role=min]"),b=l.$timePanel.filter('[data-role="range-start"]').find(".gmi-time-panel__body__item--spinner[data-role=sec]"),v=D.children("li").filter(function(){return Number(e(this).text())===f}),k=y.children("li").filter(function(){return Number(e(this).text())===h}),w=b.children("li").filter(function(){return Number(e(this).text())===_}),M=v.outerHeight();if(l.$timePanel.filter('[data-role="range-start"]').show(),!(v.length>0&&k.length>0&&w.length>0))return;v.addClass("active").siblings().removeClass("active"),k.addClass("active").siblings().removeClass("active"),w.addClass("active").siblings().removeClass("active"),D.parent().scrollTop(f*M),y.parent().scrollTop(h*M),b.parent().scrollTop(_*M)}else if("range-end"===a){
2 | var x=t&&"object"==typeof t?t.maxHour:l.maxDate?l.maxDate.getHours():l.date.getHours(),P=t&&"object"==typeof t?t.maxMin:l.maxDate?l.maxDate.getMinutes():l.date.getMinutes(),T=t&&"object"==typeof t?t.maxSec:l.maxDate?l.maxDate.getSeconds():l.date.getSeconds(),C=l.$timePanel.filter('[data-role="range-end"]').find(".gmi-time-panel__body__item--spinner[data-role=hour]"),S=l.$timePanel.filter('[data-role="range-end"]').find(".gmi-time-panel__body__item--spinner[data-role=min]"),H=l.$timePanel.filter('[data-role="range-end"]').find(".gmi-time-panel__body__item--spinner[data-role=sec]"),N=C.children("li").filter(function(){return Number(e(this).text())===x}),F=S.children("li").filter(function(){return Number(e(this).text())===P}),$=H.children("li").filter(function(){return Number(e(this).text())===T}),Y=N.outerHeight();if(l.$timePanel.filter('[data-role="range-end"]').show(),!(N.length>0&&F.length>0&&$.length>0))return;N.addClass("active").siblings().removeClass("active"),F.addClass("active").siblings().removeClass("active"),$.addClass("active").siblings().removeClass("active"),C.parent().scrollTop(x*Y),S.parent().scrollTop(P*Y),H.parent().scrollTop(T*Y)}},_getCellClasses:function(e){var t=l.type,a=[];return"normal"===e.type||"today"===e.type&&!e.disabled?(a.push("available"),"today"===e.type&&a.push("today")):a.push(e.type),"date"!==t&&"datetime"!==t||"normal"!==e.type&&"today"!==e.type||Number(e.year)!==l.date.getFullYear()||Number(e.month)!==l.date.getMonth()||Number(e.text)!==l.date.getDate()||a.push("current"),!e.inRange||"date-range"!==t&&"datetime-range"!==t||"normal"!==e.type&&"today"!==e.type||(a.push("in-range"),e.start&&a.push("start-date"),e.end&&a.push("end-date")),e.disabled&&a.push("disabled"),a.join(" ")},_setDate:function(r){var i=l.type,d=l.format;if(r){if(a(r)){if("date-range"===i||"datetime-range"===i){if(r!==l.value){l.date=r.split(" "+l.rangeSeparator+" ");var s=e.parseDate(l.date[0],d),m=e.parseDate(l.date[1],d),c=l.startDate&&n(l.startDate)?new Date(e.clearHours(l.startDate)):null,u=l.endDate&&n(l.endDate)?new Date(e.clearHours(l.endDate)):null;if(c&&(s.getTime()u.getTime()||m.getTime()>u.getTime())&&(r=""),r&&""!==r){if(!(m.getTime()>=s.getTime()))throw new Error("The maximum date must be greater than or equal to the minimum date");o._trigger("pick.datepicker",{newDate:r,oldDate:l.value}),l.value=r,l.minDate=s,l.maxDate=m,o._setRangeDateView(l.$pickerPanel),"datetime-range"===i&&(l.$pickerPanel.find('.gmi-date-picker--input[data-role="range-start"]').val(e.formatDate(s)),l.$pickerPanel.find('.gmi-date-picker--input[data-role="range-end"]').val(e.formatDate(m)),l.$pickerPanel.find('.gmi-time-picker--input[data-role="range-start"]').val(e.formatDate(s,"HH:mm:ss")),l.$pickerPanel.find('.gmi-time-picker--input[data-role="range-end"]').val(e.formatDate(m,"HH:mm:ss")),l.$pickerPanel.find(".gmi-picker-panel__link-btn--determine").removeClass("disabled")),t.val(r)}else l.date=new Date,l.limitStartDate=new Date}}else if("date"===i||"datetime"===i){var g=l.date,p=g.getTime(),f=e.parseDate(r,d),h=f.getTime();p!==h&&(o._trigger("pick.datepicker",{newDate:r,oldDate:e.formatDate(l.date,d)}),l.value=r,l.date=f,l.yearLabel=f.getFullYear(),l.monthLabel=f.getMonth(),o._setNewDateDOM(l.$pickerPanel,f.getFullYear(),f.getMonth(),f.getDate()),"datetime"===i&&(l.$pickerPanel.find(".gmi-date-picker--input").val(e.formatDate(f)),l.$pickerPanel.find(".gmi-time-picker--input").val(e.formatDate(f,"HH:mm:ss")),l.$pickerPanel.find(".gmi-picker-panel__link-btn--determine").removeClass("disabled")),t.val(r))}else if("month"===i){var _=e.formatDate(l.date,d),D=r,y=l.date.getTime(),b=new Date(e.parseDate(D,d).getFullYear(),e.parseDate(D,d).getMonth(),1).getTime();b!==y&&(o._trigger("pick.datepicker",{newDate:D,oldDate:_}),e.parseDate(D,d).getFullYear()!==l.date.getFullYear()&&(l.$pickerPanel.find(".gmi-date-picker__header__label--year").text(e.parseDate(D,d).getFullYear()+" "+l.yearSuffix),l.$pickerPanel.find(".gmi-month-table td").attr("data-year",e.parseDate(D,d).getFullYear()).data("year",e.parseDate(D,d).getFullYear())),l.value=r,l.date=new Date(e.parseDate(D,d).getFullYear(),e.parseDate(D,d).getMonth(),1),l.yearLabel=e.parseDate(D,d).getFullYear(),l.monthLabel=e.parseDate(D,d).getMonth(),o._setNewMonthDOM(l.$pickerPanel,e.parseDate(D,d).getMonth()),t.val(D))}else if("year"===i){var v=l.date.getFullYear(),k=10*Math.floor(v/10),w=Number(r),M=10*Math.floor(w/10);v!==w&&(o._trigger("pick.datepicker",{newDate:r,oldDate:v}),l.value=r,l.date=new Date(w,0,1),l.yearLabel=w,k===M?l.$pickerPanel.find(".gmi-year-table td").removeClass("current").filter(function(){return Number(e(this).text())===w}).addClass("current"):o._setNewYearDOM(l.$pickerPanel,w),t.val(w))}}else if(n(r)){if("date-range"===i||"datetime-range"===i)return;var x=e.formatDate(r,d);o._setDate(x)}}else l.date=new Date,l.limitStartDate=new Date,"date-range"===l.type&&"datetime-range"===l.type||(l.yearLabel=l.date.getFullYear(),l.monthLabel=l.date.getMonth())},_setPrevButtonAction:function(e,t){var a,n,r;switch(t){case"dateView":r=l.monthLabel-1<0?11:l.monthLabel-1,n=l.monthLabel-1<0?l.yearLabel-1:l.yearLabel,o._setNewDateDOM(e,n,r),l.yearLabel=n,l.monthLabel=r;break;case"monthView":a=e.find(".gmi-date-picker__header__label--year"),n=l.yearLabel-1,r=l.monthLabel,a.text(n+" "+l.yearSuffix),l.yearLabel=n,o._setNewMonthDOM(e,r);break;case"yearView":n=l.yearLabel-10,o._setNewYearDOM(e,n),l.yearLabel=n}},_setNextButtonAction:function(e,t){var a,n,r;switch(t){case"dateView":r=l.monthLabel+1>11?0:l.monthLabel+1,n=l.monthLabel+1>11?l.yearLabel+1:l.yearLabel,o._setNewDateDOM(e,n,r),l.yearLabel=n,l.monthLabel=r;break;case"monthView":a=e.find(".gmi-date-picker__header__label--year"),n=l.yearLabel+1,r=l.monthLabel,a.text(n+" "+l.yearSuffix),l.yearLabel=n,o._setNewMonthDOM(e,r);break;case"yearView":n=l.yearLabel+10,o._setNewYearDOM(e,n),l.yearLabel=n}},_setNewDateDOM:function(t,a,n,r){var i=o._getDateTable(new Date(a,n,r||1)),d=t.find(".gmi-picker-panel__body__main"),s=t.find(".gmi-date-picker__header__label--year"),m=t.find(".gmi-date-picker__header__label--month");s.text(a+" "+l.yearSuffix),m.show().text(l.monthsShort[n]),t.find(".gmi-date-table").remove(),e(i).appendTo(d).show().find("td").removeClass("current").filter(function(){return!e(this).hasClass("prev-month")&&!e(this).hasClass("next-month")&&a===l.date.getFullYear()&&n===l.date.getMonth()&&(e(this).text()===l.todaySuffix?(new Date).getDate():Number(e(this).text()))===l.date.getDate()}).addClass("current")},_setNewYearDOM:function(t,a,n){var r=t.find(".gmi-picker-panel__body__main"),n=n&&n.length>0?n:t.find(".gmi-date-picker__header__label--year"),i=t.find(".gmi-year-table"),d=10*Math.floor(a/10),s=d+9,m=o._getYearTable(a);i.remove(),e(m).appendTo(r).show().find("td").removeClass("current").filter(function(){return!e(this).hasClass("disabled")&&Number(e(this).text())===a}).addClass("current"),t.find(".gmi-year-table").siblings("table").hide(),n.text(d+" "+l.yearSuffix+" - "+s+" "+l.yearSuffix)},_setNewMonthDOM:function(t,a){var n=t.find(".gmi-picker-panel__body__main"),r=t.find(".gmi-month-table"),i=o._getMonthTable(a);r.remove(),e(i).appendTo(n).show(),t.find(".gmi-month-table").siblings("table").hide()},_setYearView:function(a){var n=l.$pickerPanel.find(".gmi-year-table"),r=l.$pickerPanel.find(".gmi-date-picker__header__label--year"),i=l.type,d=Number(a.text());if(n.find("td").removeClass("current"),a.addClass("current"),"date"===i||"datetime"===i||"month"===i)n.hide(),r.text(d+" "+l.yearSuffix),l.yearLabel=d,o._setNewMonthDOM(l.$pickerPanel,l.date.getMonth()),l.currentView="monthView";else if("year"===i){var s=l.date.getTime(),m=new Date(d,0,1).getTime();m!==s&&(o._trigger("pick.datepicker",{newDate:e.formatDate(new Date(d,0,1),l.format),oldDate:e.formatDate(l.date,l.format)}),l.date=new Date(d,0,1),l.value=d,l.yearLabel=d),t.val(e.formatDate(new Date(d,0,1),l.format)),o._hidePickerPanel()}},_setMonthView:function(a){var n=l.$pickerPanel,r=n.find(".gmi-month-table"),i=l.type,d=l.yearLabel,s=Number(a.data("month"));if(r.find("td").removeClass("current"),a.addClass("current"),"date"===i||"datetime"===i)o._setNewDateDOM(n,d,s),r.hide(),l.currentView="dateView";else if("month"===i){var m=l.date.getTime(),c=new Date(d,s,1).getTime();c!==m&&(o._trigger("pick.datepicker",{newDate:e.formatDate(new Date(d,s,1),l.format),oldDate:e.formatDate(l.date,l.format)}),l.date=new Date(d,s,1)),l.value=e.formatDate(new Date(d,s,1),l.format),t.val(e.formatDate(new Date(d,s,1),l.format)),o._hidePickerPanel()}l.monthLabel=s},_setRangeDateView:function(t,a){var n,r,i,d,s,m=t.find(".gmi-picker-panel__body__main.f-lt"),c=m.find(".gmi-date-range-picker__body__header > p"),u=t.find(".gmi-picker-panel__body__main.f-rt"),g=u.find(".gmi-date-range-picker__body__header > p"),p=l.limitStartDate;switch(a){case"next-year":n="getNextYear";break;case"next-month":n="getNextMonth";break;case"prev-year":n="getPrevYear";break;case"prev-month":n="getPrevMonth";break;default:n="normal"}r="normal"===n?l.minDate:e[n](p),l.limitStartDate=r,i=e.getNextMonth(r),d=o._getDateTable(r),s=o._getDateTable(i),t.find(".gmi-date-table").remove(),e(d).appendTo(m).show(),e(s).appendTo(u).show(),c.text(r.getFullYear()+" "+l.yearSuffix+" "+l.monthsShort[r.getMonth()]),g.text(i.getFullYear()+" "+l.yearSuffix+" "+l.monthsShort[i.getMonth()])},_setTimeView:function(t,a){var n=a.type,r="keyup"===n?a.which:null;if(""===t.val()&&l.$pickerPanel.find(".gmi-picker-panel__link-btn--determine").addClass("disabled"),"focusin"===n||"change"===n||"keyup"===n&&r&&13===r){var i=""!==t.val()&&e.parseDate(t.val(),"HH:mm:ss")?e.parseDate(t.val(),"HH:mm:ss").getHours():0,d=""!==t.val()&&e.parseDate(t.val(),"HH:mm:ss")?e.parseDate(t.val(),"HH:mm:ss").getMinutes():0,s=""!==t.val()&&e.parseDate(t.val(),"HH:mm:ss")?e.parseDate(t.val(),"HH:mm:ss").getSeconds():0,m=t.data("role"),c={};switch(m){case"date":c.hour=i,c.min=d,c.sec=s;break;case"range-start":c.minHour=i,c.minMin=d,c.minSec=s;break;case"range-end":c.maxHour=i,c.maxMin=d,c.maxSec=s}}o._echoTimeIntoSpinner(c,m)},_echoInputValue:function(t){"date-range"===l.type||"datetime-range"===l.type?o._setDate(t):e.parseDate(t,l.format)&&(o._setDate(e.formatDate(e.parseDate(t,l.format),l.format)),e(this).val(e.formatDate(e.parseDate(t,l.format),l.format)))},_getDatePanelPosition:function(){var a=e(window).height(),n=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,r=t.outerHeight(),i=l.$pickerPanel.outerHeight(),o=t.offset().top,d=t.offset().left,s="left"===l.align?"placement-left-bottom":"center"===l.align?"placement-center-bottom":"placement-right-bottom";return o-n>i&&o-n+r+i>a?(o-=i+2*Number(l.$pickerPanel.css("margin-top").replace(/px/,"")),l.$pickerPanel.addClass(s)):(o+=r,l.$pickerPanel.removeClass(s)),{top:o,left:d}},_setDatePanelPosition:function(){var e,a,n=t.outerWidth(),r=o._getDatePanelPosition();if(l.$pickerPanel.length>0){switch(e=l.$pickerPanel.outerWidth(),l.align){case"left":a=r.left;break;case"center":a=r.left-Math.abs(e-n)/2;break;case"right":a=r.left-Math.abs(e-n)}l.$pickerPanel.css({top:r.top+"px",left:a+"px"})}},_clear:function(){var e=l.type,a=l.$pickerPanel,n=a.find(".gmi-picker-panel__link-btn--determine"),r=a.find(".gmi-date-picker__header__label--year");a.find(".gmi-date-picker--input, .gmi-time-picker--input").val(""),n.length>0&&n.addClass("disabled"),""!==l.value&&(o._trigger("pick.datepicker",{newDate:"",oldDate:l.value}),t.val(""),l.date=new Date,l.value="",l.yearLabel=l.date.getFullYear(),l.monthLabel=l.date.getMonth()),"date-range"===e||"datetime-range"===e?(a.find(".gmi-date-table td").removeClass("start-date in-range end-date"),l.minDate=null,l.maxDate=null):"year"===e?o._setNewYearDOM(a,l.yearLabel,r):"month"===e?(r.text(l.yearLabel+" "+l.yearSuffix),o._setNewMonthDOM(a,l.monthLabel)):o._setNewDateDOM(a,l.yearLabel,l.monthLabel,(new Date).getDate())},_showPickerPanel:function(){l.$pickerPanel.is(":hidden")&&(l.$pickerPanel.show(),o._setDatePanelPosition(),r(l.$pickerPanel,"picker-show",function(){o._trigger("show.datepicker")}))},_hidePickerPanel:function(){var e=l.type,t=l.currentView;if(!l.$pickerPanel.is(":hidden"))if("date-range"===e||"datetime-range"===e||"month"===e||"year"===e)r(l.$pickerPanel,"picker-hide",function(){l.$pickerPanel.hide(),o._trigger("hide.datepicker")});else{switch(t){case"yearView":l.$pickerPanel.find(".gmi-date-picker__header__label--year").text(l.yearLabel+" "+l.yearSuffix).siblings(".gmi-date-picker__header__label--month").show();break;case"monthView":l.$pickerPanel.find(".gmi-date-picker__header__label--month").show()}r(l.$pickerPanel,"picker-hide",function(){l.$pickerPanel.hide().find(".gmi-date-table").show().siblings("table").hide(),o._trigger("hide.datepicker")})}},_elFocusHandler:function(){o._showPickerPanel()},_elClickHandler:function(e){e.stopPropagation()},_elChangeHandler:function(){var t=e(this).val();o._echoInputValue(t)},_elKeyUpHandler:function(t){var a=t.which,n=e(this).val();13===a&&o._echoInputValue(n)},_trigger:function(a,n){var r=e.Event(a,n);return t.trigger(r),r}};l.version="1.0.15",l.setDate=function(e){o._setDate(e)},l.getDate=function(){return l.value},l.show=function(){o._showPickerPanel()},l.hide=function(){o._hidePickerPanel()},l.clear=function(){o._clear()},l.disable=function(e){t.attr("disabled",e),o._hidePickerPanel()},l.destroy=function(){o._unBindEvent(),o._unCreate(),t.removeData("datepicker")},o._init()};m.LANG={"en-US":{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysMin:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yearSuffix:"",monthSuffix:"",todaySuffix:"Today",dateInputPlaceholder:"Select date",rangeStartInputPlaceholder:"Start Date",rangeEndPlaceholder:"End Date",dateTimeInputPlaceholder:"Select time",rangeStartTimeInputPlaceholder:"Start Time",rangeEndTimeInputPlaceholder:"End Time",nowDateButton:"Now",confirmDateButton:"Confirm",cancelTimeButton:"Cancel",clearButton:"Clear"}},e.fn.datepicker=function(a){var n,r=t(arguments,1),a=a||{},i=this;return i.each(function(){var t,i=e(this).data("datepicker");if(!i){if(/destroy/.test(a))return!1;if("string"!=typeof a)return e(this).data("datepicker",i=new m(e(this),a))}i&&"string"==typeof a&&e.isFunction(t=i[a])&&(n=t.apply(i,r))}),void 0===n?i:n},e.fn.datepicker.Constructor=m,e.fn.datepicker.lang=m.LANG,e.isLeapYear=function(e){return e%4==0&&e%100!=0||e%400==0},e.getTotalDayCountOfMonth=function(t,a){var n=[31,28,31,30,31,30,31,31,30,31,30,31],r=n[a];return e.isLeapYear(t)&&1===a&&r++,r},e.getWeekDay=function(e,t,a){var a=new Date(e,t-1,a);return a.getDay()},e.getFirstDayOfMonth=function(e){var t=new Date(e.getTime());return t.setDate(1),t.getDay()},e.getStartDateOfMonth=function(e,t){var a=new Date(e,t,1),n=a.getDay();return 0===n?a.setTime(a.getTime()-6048e5):a.setTime(a.getTime()-864e5*n),a},e.getWeekNumber=function(e){var t,a=new Date(e.getTime());return a.setHours(0,0,0,0),a.setDate(a.getDate()+3-(a.getDay()+6)%7),t=new Date(a.getFullYear(),0,4),1+Math.round(((a.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},e.getPrevMonth=function(t){var a=t.getFullYear(),n=t.getMonth(),r=t.getDate(),i=new Date,l=0===n?a-1:a,o=0===n?11:n-1,d=e.getTotalDayCountOfMonth(l,o);return i.setMonth(o),i.setFullYear(l),d' + text + '';
29 | return s;
30 | };
31 |
32 | gulp.task('copy-html', function () {
33 | return gulp.src(srcBasePath + '**/*.html')
34 | .pipe(gulp.dest(distBasePath))
35 | .pipe($dev().connect.reload());
36 | });
37 |
38 | gulp.task('process-docs', function () {
39 | return gulp.src(srcDocsPath + '**/*.md')
40 | .pipe(markdown({renderer: renderer}))
41 | .pipe(gulp.dest(distDocsPath))
42 | .pipe($dev().connect.reload());
43 | });
44 |
45 | gulp.task('copy-assets', function () {
46 | return gulp.src(srcAssetsPath + '**/*.{js,css,jpg,png,ico}')
47 | .pipe(gulp.dest(distAssetsPath))
48 | .pipe($dev().connect.reload());
49 | });
50 |
51 | gulp.task('process-component-sass', function () {
52 | return gulp.src(componentSassList)
53 | .pipe($dev().sass())
54 | .pipe(inline_base64({
55 | baseDir: srcAssetsPath,
56 | maxSize: 14,
57 | debug: true
58 | }))
59 | .pipe($dev().autoprefixer({
60 | browsers: ["last 10 versions"]
61 | }))
62 | .pipe($dev().concat('jquery.datepicker.css'))
63 | .pipe(gulp.dest(distBasePath + 'css'))
64 | .pipe($dev().minifyCss())
65 | .pipe($dev().rename('jquery.datepicker.min.css'))
66 | .pipe(gulp.dest(distBasePath + 'css'))
67 | .pipe($dev().connect.reload());
68 | });
69 |
70 | gulp.task('process-component-js', function () {
71 | return gulp.src(srcBasePath + 'js/*.js')
72 | .pipe($dev().concat('jquery.datepicker.js'))
73 | .pipe(gulp.dest(distBasePath + 'js/'))
74 | .pipe(gulpUglify())
75 | .pipe($dev().rename('jquery.datepicker.min.js'))
76 | .pipe(gulp.dest(distBasePath + 'js'))
77 | .pipe($dev().connect.reload());
78 | });
79 |
80 | gulp.task('process-i18n-js', function () {
81 | return gulp.src(srcI18nPath + '*.js')
82 | .pipe(gulp.dest(distI18nPath))
83 | .pipe($dev().connect.reload());
84 | });
85 |
86 | gulp.task('server', function () {
87 | $dev().connect.server({
88 | root: distBasePath,
89 | port: 8081,
90 | livereload: true
91 | });
92 | });
93 |
94 | // Watch task.
95 | gulp.task('watch', function () {
96 | gulp.watch(srcBasePath + '**/*.html', ['copy-html']);
97 | gulp.watch(srcDocsPath + '**/*.md', ['process-docs']);
98 | gulp.watch(componentSassList, ['process-component-sass']);
99 | gulp.watch(srcBasePath + 'js/*.js', ['process-component-js']);
100 | gulp.watch(srcI18nPath + '*.js', ['process-i18n-js']);
101 | gulp.watch(srcAssetsPath + '**/*.{js,css}', ['copy-assets']);
102 | });
103 |
104 | gulp.task('default', ['copy-html', 'copy-assets', 'process-docs',
105 | 'process-component-sass', 'process-component-js', 'process-i18n-js',
106 | 'server', 'watch']);
107 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gemini-datepicker",
3 | "version": "1.0.15",
4 | "description": "A full-featured datepicker jquery plugin.",
5 | "homepage": "https://github.com/gregzhang616/jquery-datepicker.git",
6 | "main": "dist/js/jquery.datepicker.min.js",
7 | "keywords": [
8 | "date",
9 | "picker",
10 | "datepicker",
11 | "calendar",
12 | "jquery",
13 | "jquery-datepicker",
14 | "plugin",
15 | "javascript"
16 | ],
17 | "author": "Greg Zhang",
18 | "license": "MIT",
19 | "private": false,
20 | "devDependencies": {
21 | "gulp": "^3.9.1",
22 | "gulp-autoprefixer": "^3.1.1",
23 | "gulp-concat": "^2.6.1",
24 | "gulp-connect": "^5.0.0",
25 | "gulp-inline-base64": "^0.1.5",
26 | "gulp-load-plugins": "^1.4.0",
27 | "gulp-markdown": "^1.2.0",
28 | "gulp-markdown-docs": "^0.1.5",
29 | "gulp-minify-css": "^1.2.4",
30 | "gulp-rename": "^1.2.2",
31 | "gulp-sass": "^3.1.0",
32 | "gulp-uglify": "^2.0.1",
33 | "pygmentize-bundled": "^2.3.0"
34 | },
35 | "dependencies": {
36 | "jquery": ">= 1.9.1"
37 | },
38 | "repository": "https://github.com/gregzhang616/jquery-datepicker.git"
39 | }
40 |
--------------------------------------------------------------------------------
/src/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 |
--------------------------------------------------------------------------------
/src/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 |
--------------------------------------------------------------------------------
/src/assets/images/arrow-down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/arrow-down.png
--------------------------------------------------------------------------------
/src/assets/images/arrow-up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/arrow-up.png
--------------------------------------------------------------------------------
/src/assets/images/datepicker-date-range.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/datepicker-date-range.png
--------------------------------------------------------------------------------
/src/assets/images/datepicker-date.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/datepicker-date.png
--------------------------------------------------------------------------------
/src/assets/images/datepicker-datetime-range.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/datepicker-datetime-range.png
--------------------------------------------------------------------------------
/src/assets/images/datepicker-datetime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/datepicker-datetime.png
--------------------------------------------------------------------------------
/src/assets/images/datepicker-month.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/datepicker-month.png
--------------------------------------------------------------------------------
/src/assets/images/datepicker-year.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/datepicker-year.png
--------------------------------------------------------------------------------
/src/assets/images/double-arrow-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/double-arrow-left.png
--------------------------------------------------------------------------------
/src/assets/images/double-arrow-right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/double-arrow-right.png
--------------------------------------------------------------------------------
/src/assets/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/favicon.ico
--------------------------------------------------------------------------------
/src/assets/images/gemini-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/gemini-dark.png
--------------------------------------------------------------------------------
/src/assets/images/gemini.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/gemini.png
--------------------------------------------------------------------------------
/src/assets/images/github-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/github-dark.png
--------------------------------------------------------------------------------
/src/assets/images/github-gemini.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/github-gemini.png
--------------------------------------------------------------------------------
/src/assets/images/github-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/github-white.png
--------------------------------------------------------------------------------
/src/assets/images/left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/left.png
--------------------------------------------------------------------------------
/src/assets/images/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gregzhang616/jquery-datepicker/05fba850a016759dc5409e6b9c24de35e7642926/src/assets/images/right.png
--------------------------------------------------------------------------------
/src/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 |
--------------------------------------------------------------------------------
/src/examples/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Guideline
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
19 |
32 |
45 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/src/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 |
--------------------------------------------------------------------------------
/src/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 |
--------------------------------------------------------------------------------
/src/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 |
--------------------------------------------------------------------------------
/src/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 |
--------------------------------------------------------------------------------
/src/sass/datepicker-date.scss:
--------------------------------------------------------------------------------
1 | $primaryColor: #038cd6;
2 | $inRangeColor: #c2dcef;
3 | $defaultColor: #8391a5;
4 |
5 | .gmi-date-picker {
6 | width: 254px;
7 | transition: all ease-in-out 0.2s;
8 |
9 | @at-root &.has-time {
10 | width: 324px;
11 | }
12 |
13 | &__header__icon-btn {
14 | display: inline-block;
15 | width: 16px;
16 | height: 16px;
17 | vertical-align: middle;
18 | margin: 3px 0;
19 | float: right;
20 | cursor: pointer;
21 | color: #475669!important;
22 |
23 | &:hover {
24 | color: $primaryColor;
25 | }
26 | }
27 |
28 | &[data-role='year'] {
29 | .gmi-date-picker__header__label--year:hover {
30 | color: #475669!important;
31 | cursor: default;
32 | }
33 | }
34 | }
35 |
36 | .gmi-picker-panel {
37 | line-height: 20px;
38 | color: #475669;
39 | background-color: #fff;
40 | border: 1px solid #d3dce6;
41 | border-radius: 2px;
42 | box-shadow: 0 2px 5px #ccc;
43 | margin: 5px 0;
44 | z-index: 2008;
45 |
46 | span {
47 | color: #475669;
48 | font-size: 14px;
49 | padding: 0 3px;
50 | cursor: pointer;
51 |
52 | &:first-child {
53 | padding-left: 0;
54 | }
55 |
56 | &:hover {
57 | color: $primaryColor;
58 | text-decoration: none;
59 | }
60 | }
61 |
62 | &__body {
63 | width: 100%;
64 | height: 100%;
65 | }
66 |
67 | &__body__header {
68 | line-height: 22px;
69 | padding: 12px 20px 5px;
70 |
71 | span[class^=gmi-date-picker__header__label--]{
72 | color: #475669 !important;
73 |
74 | &:hover {
75 | color: $primaryColor!important;
76 | }
77 | }
78 | }
79 |
80 | .gmi-year-picker__header, .gmi-month-picker__header {
81 | padding-bottom: 10px;
82 | }
83 |
84 | &__body__header--time {
85 | padding: 8px;
86 | border-bottom: 1px solid #d3dce6;
87 | min-height: 30px;
88 |
89 | &__wrapper {
90 | width: 50%;
91 | float: left;
92 | padding: 0 5px;
93 | box-sizing: border-box;
94 |
95 | .gmi-input {
96 | width: 100%;
97 | display: inline-block;
98 |
99 | &__inner {
100 | width: 100%;
101 | height: 30px;
102 | -webkit-appearance: none;
103 | -moz-appearance: none;
104 | border-radius: 2px;
105 | border: 1px solid #bfcbd9;
106 | box-sizing: border-box;
107 | color: #1f2d3d;
108 | display: block;
109 | line-height: 1;
110 | outline: none;
111 | padding: 3px 10px;
112 | font-size: 13px;
113 | transition: border-color .4s cubic-bezier(.645,.045,.355,1);
114 |
115 | &:hover {
116 | border: 1px solid $primaryColor;
117 | }
118 | }
119 | }
120 |
121 | .gmi-time-picker--wrapper {
122 | position: relative;
123 | zoom: 1;
124 | }
125 | }
126 | }
127 |
128 | &__btn--prev {
129 | background: url("/images/arrow-up.png",true) no-repeat center center;
130 | background-size: 100% 100%;
131 | }
132 |
133 | &__btn--next {
134 | background: url("/images/arrow-down.png",true) no-repeat center center;
135 | background-size: 100% 100%;
136 | margin-left: 15px;
137 | }
138 |
139 | &__body__main {
140 | min-width: 224px;
141 | padding: 0 15px 15px;
142 | }
143 |
144 | // 导入基础日历表格样式
145 | @import "datepicker-table";
146 |
147 | &__footer {
148 | padding: 0 8px;
149 | border-top: 1px solid #d3dce6;
150 | text-align: right;
151 | background-color: #fff;
152 |
153 | .gmi-picker-panel__link-btn {
154 | display: inline-block;
155 | color: $primaryColor;
156 | padding: 10px 5px;
157 |
158 | &--default {
159 | color: $defaultColor;
160 | }
161 |
162 | &--primary {
163 | color: $primaryColor;
164 | }
165 |
166 | &:hover {
167 | text-decoration: none;
168 | }
169 |
170 | &.disabled {
171 | color: #ccc;
172 | cursor: not-allowed;
173 | }
174 | }
175 | }
176 |
177 | &.placement-left-bottom {
178 | -ms-transform-origin: 0 bottom!important;
179 | transform-origin: 0 bottom!important;
180 | }
181 |
182 | &.placement-center-bottom {
183 | -ms-transform-origin: 50% bottom!important;
184 | transform-origin: 50% bottom!important;
185 | }
186 |
187 | &.placement-right-bottom {
188 | -ms-transform-origin: 100% bottom!important;
189 | transform-origin: 100% bottom!important;
190 | }
191 | }
192 |
193 | // 导入双日历样式
194 | @import "datepicker-range";
195 |
196 | // 导入时间选择器样式
197 | @import "timepicker";
198 |
199 | .picker-show {
200 | animation: showPanel 0.2s ease-in-out;
201 | -webkit-animation: showPanel 0.2s ease-in-out;
202 | animation-fill-mode: forwards;
203 | }
204 |
205 | .picker-hide {
206 | animation: hidePanel 0.2s ease-in-out;
207 | -webkit-animation: hidePanel 0.2s ease-in-out;
208 | animation-fill-mode: forwards;
209 | }
210 |
211 | @-webkit-keyframes showPanel {
212 | 0% {
213 | opacity: 0;
214 | transform: scale(0, 0);
215 | -ms-transform: scale(0, 0);
216 | }
217 |
218 | 100% {
219 | opacity: 1;
220 | transform: scale(1, 1);
221 | -ms-transform: scale(1, 1);
222 | }
223 | }
224 | @-webkit-keyframes hidePanel {
225 | 0% {
226 | opacity: 1;
227 | transform: scale(1, 1);
228 | -ms-transform: scale(1, 1);
229 | }
230 |
231 | 100% {
232 | opacity: 0;
233 | transform: scale(0, 0);
234 | -ms-transform: scale(0, 0);
235 | }
236 | }
237 |
--------------------------------------------------------------------------------
/src/sass/datepicker-range.scss:
--------------------------------------------------------------------------------
1 | .gmi-date-range-picker {
2 | width: 520px;
3 | transition: all ease-in-out 0.2s;
4 |
5 | @at-root &.has-time {
6 | width: 660px;
7 | }
8 |
9 | &__body {
10 | clear: both;
11 | overflow: hidden;
12 |
13 | &__header {
14 | font-size: 14px;
15 | text-align: center;
16 | position: relative;
17 | padding-bottom: 5px;
18 | }
19 |
20 | .gmi-picker-panel__body__main {
21 | width: 50%;
22 | box-sizing: border-box;
23 | margin: 0;
24 | padding: 15px;
25 | }
26 | }
27 |
28 | &__header--time__wrapper {
29 | .gmi-input {
30 | float: left;
31 | width: 50%;
32 | padding: 0 5px;
33 | box-sizing: border-box;
34 | }
35 | }
36 |
37 | &__header__icon-btn {
38 | position: absolute;
39 | top: 0;
40 | cursor: pointer;
41 | width: 16px;
42 | height: 16px;
43 |
44 | &:hover {
45 | color: $primaryColor;
46 | }
47 | }
48 |
49 | &__btn--prev {
50 | left: 5px;
51 | background: url("/images/double-arrow-left.png",true) no-repeat center center;
52 | background-size: 100% 100%;
53 |
54 | &-month {
55 | background: url("/images/left.png",true) no-repeat center center;
56 | background-size: 100% 100%;
57 | left: 25px;
58 | }
59 | }
60 |
61 | &__btn--next {
62 | background: url("/images/double-arrow-right.png",true) no-repeat center center;
63 | background-size: 100% 100%;
64 | right: 5px;
65 |
66 | &-month {
67 | background: url("/images/right.png",true) no-repeat center center;
68 | background-size: 100% 100%;
69 | right: 25px;
70 | }
71 | }
72 |
73 | .f-lt {
74 | float: left;
75 | border-right: 1px solid #d3dce6;
76 | }
77 |
78 | .f-rt {
79 | float: right;
80 | }
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/src/sass/datepicker-table.scss:
--------------------------------------------------------------------------------
1 | @mixin base-table-style {
2 | font-size: 12px!important;
3 | min-width: 224px;
4 | -webkit-user-select: none;
5 | }
6 |
7 | table {
8 | width: 100%;
9 | table-layout: fixed;
10 | border-collapse: collapse;
11 | border-spacing: 0;
12 | }
13 |
14 | .gmi-date-table {
15 | @include base-table-style;
16 |
17 | th {
18 | padding: 5px;
19 | color: #8492a6;
20 | font-size: 12px!important;
21 | font-weight: 400;
22 | text-align: center;
23 | }
24 |
25 | td {
26 | width: 32px;
27 | height: 32px;
28 | box-sizing: border-box;
29 | text-align: center;
30 | cursor: pointer;
31 | vertical-align: middle;
32 | font-size: 12px!important;
33 | color: #475669;
34 |
35 | &.today {
36 | color: $primaryColor;
37 | }
38 |
39 | &.current {
40 | background-color: $primaryColor;
41 | color: #fff;
42 | }
43 |
44 | &.disabled {
45 | background-color: #f5f5f5;
46 | opacity: 1;
47 | cursor: not-allowed;
48 | color: #ddd;
49 | &:hover {
50 | background-color: #f5f5f5!important;
51 | }
52 | }
53 |
54 | &.available {
55 | &:not(.current):hover {
56 | background-color: #e5e9f2;
57 | }
58 | }
59 |
60 | &.next-month, &.prev-month {
61 | color: #ddd;
62 | }
63 |
64 | &.in-range {
65 | background-color: $inRangeColor;
66 | &:hover {
67 | background-color: $inRangeColor!important;
68 | }
69 | }
70 |
71 | &.start-date, &.end-date {
72 | background-color: $primaryColor;
73 | color: #fff;
74 |
75 | &:hover {
76 | background-color: $primaryColor!important;
77 | }
78 | }
79 | }
80 | }
81 |
82 | .gmi-year-table, .gmi-month-table {
83 | @include base-table-style;
84 |
85 | td {
86 | padding: 22px 3px;
87 | vertical-align: middle;
88 |
89 | .cell {
90 | height: 32px;
91 | display: block;
92 | line-height: 32px;
93 | text-align: center;
94 | cursor: pointer;
95 | font-size: 12px!important;
96 | color: #475669!important;
97 |
98 | &:not(.current):hover {
99 | background-color: #e5e9f2;
100 | }
101 | }
102 |
103 | &.current {
104 | .cell {
105 | background-color: $primaryColor!important;
106 | color: #fff!important;
107 | }
108 | }
109 |
110 | &.disabled {
111 | .cell {
112 | background-color: #f5f5f5;
113 | opacity: 1;
114 | cursor: not-allowed;
115 | color: #ddd!important;
116 | &:hover {
117 | background-color: #f5f5f5!important;
118 | }
119 | }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/src/sass/timepicker.scss:
--------------------------------------------------------------------------------
1 | .gmi-time-panel {
2 | margin: 5px 0;
3 | color: #475669;
4 | background-color: #fff;
5 | border: 1px solid #d1dbe5;
6 | box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 0 6px rgba(0,0,0,.04);
7 | border-radius: 2px;
8 | transform-origin: center top 0;
9 | z-index: 2011;
10 | -webkit-user-select: none;
11 | user-select: none;
12 |
13 | &__body {
14 | width: 100%;
15 | height: 100%;
16 | position: relative;
17 | overflow: hidden;
18 |
19 | &:before {
20 | content: ":";
21 | padding-left: 33.33333%;
22 | top: 50%;
23 | color: #fff;
24 | position: absolute;
25 | font-size: 14px;
26 | -webkit-transform: translateY(-50%);
27 | -moz-transform: translateY(-50%);
28 | -ms-transform: translateY(-50%);
29 | -o-transform: translateY(-50%);
30 | transform: translateY(-50%);
31 | line-height: 16px;
32 | background-color: lighten($primaryColor, 5%);
33 | height: 32px;
34 | left: 0;
35 | right: 0;
36 | box-sizing: border-box;
37 | padding-top: 6px;
38 | text-align: left;
39 | }
40 |
41 | &:after {
42 | content: ":";
43 | top: 50%;
44 | color: #fff;
45 | position: absolute;
46 | font-size: 14px;
47 | -webkit-transform: translateY(-50%);
48 | -moz-transform: translateY(-50%);
49 | -ms-transform: translateY(-50%);
50 | -o-transform: translateY(-50%);
51 | transform: translateY(-50%);
52 | line-height: 16px;
53 | background-color: lighten($primaryColor, 5%);
54 | height: 32px;
55 | left: 66.66667%;
56 | right: 0;
57 | box-sizing: border-box;
58 | padding-top: 6px;
59 | text-align: left
60 | }
61 |
62 | &__item {
63 | width: 33.33%;
64 | height: 100%;
65 | overflow: hidden;
66 | position: relative;
67 | z-index: 1;
68 | float: left;
69 | text-align: center;
70 |
71 | &--spinner {
72 | width: 100%;
73 | max-height: 192px;
74 |
75 | &:before {
76 | content: " ";
77 | display: block;
78 | width: 100%;
79 | height: 80px;
80 | }
81 |
82 | &:after {
83 | content: " ";
84 | display: block;
85 | width: 100%;
86 | height: 80px;
87 | }
88 |
89 | &__item {
90 | height: 32px;
91 | line-height: 32px;
92 | font-size: 12px;
93 | cursor: pointer;
94 |
95 | &.active {
96 | color: #fff;
97 |
98 | &:hover {
99 | cursor: default;
100 | }
101 | }
102 |
103 | &.disabled {
104 | color: #cecece;
105 | cursor: not-allowed;
106 | }
107 | }
108 | }
109 | }
110 | }
111 | }
112 |
--------------------------------------------------------------------------------