Gmedia Photo Gallery - Version 1.13.2

Version Description

Download this release

Release Info

Developer pasyuk
Plugin Icon 128x128 Gmedia Photo Gallery
Version 1.13.2
Comparing to
See all releases

Code changes from version 1.12.4 to 1.13.2

admin/admin.php CHANGED
@@ -201,6 +201,13 @@ class GmediaAdmin {
201
  <small> by CodEasily.com</small>
202
  </div>
203
  <h2><?php echo $sideLinks['grandTitle']; ?></h2>
 
 
 
 
 
 
 
204
  </div>
205
  <div class="container-fluid">
206
  <div class="row row-fx180-fl">
@@ -505,13 +512,13 @@ class GmediaAdmin {
505
 
506
  wp_enqueue_script('jquery-ui-sortable');
507
 
508
- wp_enqueue_script('moment', $gmCore->gmedia_url . '/assets/bootstrap-datetimepicker/moment.min.js', array('jquery'), '2.5.1');
509
- wp_enqueue_style('datetimepicker', $gmCore->gmedia_url . '/assets/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css', array('gmedia-bootstrap'), '2.1.32');
510
  wp_enqueue_script('datetimepicker', $gmCore->gmedia_url . '/assets/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js', array(
511
  'jquery',
512
  'moment',
513
  'gmedia-bootstrap'
514
- ), '2.1.32');
515
  }
516
  }
517
  wp_enqueue_script('wavesurfer', $gmCore->gmedia_url . '/assets/wavesurfer/wavesurfer.min.js', array('jquery'), '1.1.5');
201
  <small> by CodEasily.com</small>
202
  </div>
203
  <h2><?php echo $sideLinks['grandTitle']; ?></h2>
204
+ <?php
205
+ if ( ! is_plugin_active( 'woowbox/woowbox.php' ) ){
206
+ ?>
207
+ <div class="promote-woowbox"><a href="https://bit.ly/woowbox" target="_blank"><img src="<?php echo plugins_url('/grand-media/admin/assets/img/woowbox-promote.png') ?>" alt="Try WoowBox Gallery plugin" /></a></div>
208
+ <?php
209
+ }
210
+ ?>
211
  </div>
212
  <div class="container-fluid">
213
  <div class="row row-fx180-fl">
512
 
513
  wp_enqueue_script('jquery-ui-sortable');
514
 
515
+ wp_enqueue_script('moment', $gmCore->gmedia_url . '/assets/bootstrap-datetimepicker/moment.min.js', array('jquery'), '2.22.2');
516
+ wp_enqueue_style('datetimepicker', $gmCore->gmedia_url . '/assets/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css', array('gmedia-bootstrap'), '4.17.47');
517
  wp_enqueue_script('datetimepicker', $gmCore->gmedia_url . '/assets/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js', array(
518
  'jquery',
519
  'moment',
520
  'gmedia-bootstrap'
521
+ ), '4.17.47');
522
  }
523
  }
524
  wp_enqueue_script('wavesurfer', $gmCore->gmedia_url . '/assets/wavesurfer/wavesurfer.min.js', array('jquery'), '1.1.5');
admin/assets/css/gmedia.admin.css CHANGED
@@ -23,6 +23,10 @@ input[type="checkbox"] {
23
  input[type="checkbox"], input[type="radio"] {
24
  height:16px;
25
  width:16px;
 
 
 
 
26
  }
27
  .checkbox, .radio {
28
  margin-top:5px;
@@ -119,7 +123,11 @@ body.gmedia-blank div#gmedia-container {
119
  div#gmedia-header {
120
  position:relative;
121
  padding:1px 1px 10px 1px;
 
 
 
122
  }
 
123
  /*noinspection CssInvalidElement*/
124
  div#gmedia-logo {
125
  position:relative;
@@ -150,6 +158,14 @@ div#gmedia-header h2 {
150
  margin:0;
151
  font:italic 24px/35px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
152
  color:#ffffff;
 
 
 
 
 
 
 
 
153
  }
154
  #ajax-long-operation {
155
  position:absolute;
@@ -275,7 +291,7 @@ body.gmedia-blank .panel-absoluteHeader .panel-heading,
275
  border-bottom-right-radius:3px;
276
  border-bottom-left-radius:3px;
277
  }
278
- .dropdown-menu {
279
  max-height: calc(100vh - 50px);
280
  overflow-y: auto;
281
  }
@@ -1297,6 +1313,10 @@ div#wp-link-wrap label {
1297
  margin: 0;
1298
  }
1299
 
 
 
 
 
1300
  @media (min-width:782px) {
1301
  div.modal {
1302
  top:32px;
23
  input[type="checkbox"], input[type="radio"] {
24
  height:16px;
25
  width:16px;
26
+ min-width: 0 !important;
27
+ }
28
+ input[type="button"] {
29
+ min-width: 0 !important;
30
  }
31
  .checkbox, .radio {
32
  margin-top:5px;
123
  div#gmedia-header {
124
  position:relative;
125
  padding:1px 1px 10px 1px;
126
+ display: flex;
127
+ flex-wrap: wrap;
128
+ align-items: center;
129
  }
130
+
131
  /*noinspection CssInvalidElement*/
132
  div#gmedia-logo {
133
  position:relative;
158
  margin:0;
159
  font:italic 24px/35px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
160
  color:#ffffff;
161
+ flex: 1 1 180px;
162
+ }
163
+ div#gmedia-header .promote-woowbox {
164
+ flex: 1 1 50%;
165
+ margin-top: -10px;
166
+ }
167
+ div#gmedia-header .promote-woowbox img {
168
+ border: 1px solid rgba(255, 255, 255, 0.7);
169
  }
170
  #ajax-long-operation {
171
  position:absolute;
291
  border-bottom-right-radius:3px;
292
  border-bottom-left-radius:3px;
293
  }
294
+ .dropdown-menu:not(.bootstrap-datetimepicker-widget) {
295
  max-height: calc(100vh - 50px);
296
  overflow-y: auto;
297
  }
1313
  margin: 0;
1314
  }
1315
 
1316
+ .input-group.gmedia_date input {
1317
+ pointer-events: none;
1318
+ }
1319
+
1320
  @media (min-width:782px) {
1321
  div.modal {
1322
  top:32px;
admin/assets/img/woowbox-promote.png ADDED
Binary file
admin/assets/js/gmedia.admin.js CHANGED
@@ -298,7 +298,7 @@ var GmediaLibrary = {
298
 
299
  // Date/Time picker
300
  var gmedia_date_temp;
301
- jQuery('.input-group.gmedia_date').datetimepicker({useSeconds: true}).on('dp.show', function() {
302
  gmedia_date_temp = jQuery('input', this).val();
303
  }).on('dp.hide', function() {
304
  if(gmedia_date_temp != jQuery('input', this).val()) {
@@ -636,7 +636,7 @@ var GmediaTerms = {
636
 
637
  // Date/Time picker
638
  if(jQuery.fn.datetimepicker){
639
- jQuery('.input-group.gmedia_date').datetimepicker({useSeconds: true});
640
  }
641
 
642
  }
@@ -1089,7 +1089,7 @@ var GmediaFunction = {
1089
  backdrop: true,
1090
  show: true
1091
  }).one('hidden.bs.modal', function() {
1092
- if (jQuery('.gmedia-modal:visible').length) {
1093
  jQuery('body').addClass('modal-open');
1094
  }
1095
  modal_title.empty();
298
 
299
  // Date/Time picker
300
  var gmedia_date_temp;
301
+ jQuery('.input-group.gmedia_date').datetimepicker({format: 'YYYY-MM-DD HH:mm:ss', focusOnShow: false}).on('dp.show', function() {
302
  gmedia_date_temp = jQuery('input', this).val();
303
  }).on('dp.hide', function() {
304
  if(gmedia_date_temp != jQuery('input', this).val()) {
636
 
637
  // Date/Time picker
638
  if(jQuery.fn.datetimepicker){
639
+ jQuery('.input-group.gmedia_date').datetimepicker({format: 'YYYY-MM-DD HH:mm:ss', focusOnShow: false});
640
  }
641
 
642
  }
1089
  backdrop: true,
1090
  show: true
1091
  }).one('hidden.bs.modal', function() {
1092
+ if (jQuery('div.gmedia-modal:visible').length) {
1093
  jQuery('body').addClass('modal-open');
1094
  }
1095
  modal_title.empty();
admin/pages/library/tpl/edit-item.php CHANGED
@@ -195,9 +195,8 @@ if ( ! defined( 'ABSPATH' ) ) {
195
  <label><?php _e( 'Date', 'grand-media' ); ?></label>
196
 
197
  <div class="input-group gmedia_date input-group-sm" data-date-format="YYYY-MM-DD HH:mm:ss">
198
- <input name="date" type="text" readonly="readonly" class="form-control input-sm" value="<?php echo $item->date; ?>"/>
199
- <span class="input-group-btn"><button type="button" class="btn btn-primary">
200
- <span class="glyphicon glyphicon-calendar"></span></button></span>
201
  </div>
202
  </div>
203
  <div class="form-group status-item bg-status-<?php echo $item->status; ?>">
195
  <label><?php _e( 'Date', 'grand-media' ); ?></label>
196
 
197
  <div class="input-group gmedia_date input-group-sm" data-date-format="YYYY-MM-DD HH:mm:ss">
198
+ <input name="date" type="text" class="form-control input-sm" value="<?php echo $item->date; ?>" tabindex="-1"/>
199
+ <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
 
200
  </div>
201
  </div>
202
  <div class="form-group status-item bg-status-<?php echo $item->status; ?>">
admin/pages/modules/edit-preset.php CHANGED
@@ -85,3 +85,17 @@ do_action( 'gmedia_module_preset_before_panel' );
85
  <?php
86
  do_action( 'gmedia_module_preset_after_panel' );
87
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  <?php
86
  do_action( 'gmedia_module_preset_after_panel' );
87
  ?>
88
+ <div class="modal fade gmedia-modal" id="previewModal" tabindex="-1" role="dialog" aria-hidden="true">
89
+ <div class="modal-dialog">
90
+ <div class="modal-content">
91
+ <div class="modal-header">
92
+ <div class="btn-toolbar pull-right" style="margin-top:-4px;">
93
+ <button type="button" class="btn btn-primary"><?php _e('Submit', 'grand-media'); ?></button>
94
+ <button type="button" class="btn btn-default" data-dismiss="modal"><?php _e('Close', 'grand-media'); ?></button>
95
+ </div>
96
+ <h4 class="modal-title"></h4>
97
+ </div>
98
+ <div class="modal-body"></div>
99
+ </div>
100
+ </div>
101
+ </div>
admin/pages/settings/tpl/common.php CHANGED
@@ -20,6 +20,20 @@ if(!defined('ABSPATH')){
20
  </select>
21
  </div>
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  <hr />
24
  <div class="form-group row">
25
  <div class="col-xs-6">
20
  </select>
21
  </div>
22
 
23
+ <hr />
24
+ <div class="form-group">
25
+ <label><?php esc_html_e('Google API Key', 'grand-media') ?></label>
26
+ <div class="row">
27
+ <div class="col-xs-6">
28
+ <input type="text" name="set[google_api_key]" class="form-control input-sm" value="<?php echo esc_attr($gmGallery->options['google_api_key']) ?>">
29
+ </div>
30
+ <div class="col-xs-6">
31
+ <p style="padding-top: 5px"><a target="_blank" href="https://support.google.com/googleapi/answer/6158862"><?php _e('How to create a Google API Key', 'grand-media') ?></a></p>
32
+ </div>
33
+ </div>
34
+ <p class="help-block"><?php _e('This API key is required to using Google Map in admin and in the gallery modules.', 'grand-media'); ?></p>
35
+ </div>
36
+
37
  <hr />
38
  <div class="form-group row">
39
  <div class="col-xs-6">
admin/pages/settings/tpl/system.php CHANGED
@@ -5,7 +5,7 @@ if(!defined('ABSPATH')) {
5
  }
6
 
7
  /**
8
- * System info (under constraction)
9
  */
10
  ?>
11
  <fieldset id="gmedia_settings_sysinfo" class="tab-pane">
@@ -17,7 +17,7 @@ if(!defined('ABSPATH')) {
17
  echo '<p>' . __('PHP Memory Used: ', 'grand-media') . $memory_usage . 'M</p>';
18
  }
19
  ?>
20
- <p><?php _e('Under constraction...') ?></p>
21
 
22
  <?php
23
  if ($gmCore->_get('showdb')) {
5
  }
6
 
7
  /**
8
+ * System info (under construction)
9
  */
10
  ?>
11
  <fieldset id="gmedia_settings_sysinfo" class="tab-pane">
17
  echo '<p>' . __('PHP Memory Used: ', 'grand-media') . $memory_usage . 'M</p>';
18
  }
19
  ?>
20
+ <p><?php _e('Under construction...') ?></p>
21
 
22
  <?php
23
  if ($gmCore->_get('showdb')) {
admin/pages/terms/tpl/album-edit-item.php CHANGED
@@ -163,9 +163,8 @@ $_module_preset = !empty($term->meta['_module_preset'][0])? $term->meta['_module
163
  <label><?php _e('Date', 'grand-media'); ?></label>
164
 
165
  <div class="input-group gmedia_date input-group-sm" data-date-format="YYYY-MM-DD HH:mm:ss">
166
- <input name="term[post_date]" type="text" readonly="readonly" class="form-control input-sm" value="<?php echo $term->post_date; ?>"/>
167
- <span class="input-group-btn"><button type="button" class="btn btn-primary">
168
- <span class="glyphicon glyphicon-calendar"></span></button></span>
169
  </div>
170
  </div>
171
  <?php } ?>
163
  <label><?php _e('Date', 'grand-media'); ?></label>
164
 
165
  <div class="input-group gmedia_date input-group-sm" data-date-format="YYYY-MM-DD HH:mm:ss">
166
+ <input name="term[post_date]" type="text" readonly="readonly" class="form-control input-sm" value="<?php echo $term->post_date; ?>" tabindex="-1"/>
167
+ <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
 
168
  </div>
169
  </div>
170
  <?php } ?>
admin/processor/class.processor.galleries.php CHANGED
@@ -171,6 +171,11 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
171
  $this->error[] = sprintf(__('Can\'t load data from `%s` module'), $term['module']);
172
  break;
173
  }
 
 
 
 
 
174
  $module_settings = $gmCore->array_replace_recursive($default_options, $module_settings);
175
  wp_parse_str($term['query'], $_query);
176
  $gallery_meta = array('_edited' => gmdate('Y-m-d H:i:s'),
171
  $this->error[] = sprintf(__('Can\'t load data from `%s` module'), $term['module']);
172
  break;
173
  }
174
+ foreach($module_settings as &$setting){
175
+ if(is_string( $setting) && 7 === strlen( $setting ) && '#' === $setting[0] ){
176
+ $setting = ltrim( $setting, '#');
177
+ }
178
+ }
179
  $module_settings = $gmCore->array_replace_recursive($default_options, $module_settings);
180
  wp_parse_str($term['query'], $_query);
181
  $gallery_meta = array('_edited' => gmdate('Y-m-d H:i:s'),
admin/processor/class.processor.modules.php CHANGED
@@ -78,6 +78,11 @@ class GmediaProcessor_Modules extends GmediaProcessor{
78
 
79
 
80
  $module_settings = $gmCore->_post('module', array());
 
 
 
 
 
81
  $module_path = $gmCore->get_module_path($term['module']);
82
  $default_options = array();
83
  if(is_file($module_path['path'] . '/settings.php')){
78
 
79
 
80
  $module_settings = $gmCore->_post('module', array());
81
+ foreach($module_settings as &$setting){
82
+ if(is_string( $setting) && 7 === strlen( $setting ) && '#' === $setting[0] ){
83
+ $setting = ltrim( $setting, '#');
84
+ }
85
+ }
86
  $module_path = $gmCore->get_module_path($term['module']);
87
  $default_options = array();
88
  if(is_file($module_path['path'] . '/settings.php')){
app/access.php CHANGED
@@ -16,8 +16,9 @@ if(!$gmedia_app){
16
  die();
17
  }
18
 
19
- global $gmCore, $gmapp_version;
20
  $gmapp_version = isset($_GET['gmappversion'])? $_GET['gmappversion'] : 1;
 
21
 
22
  $out = array();
23
 
@@ -36,14 +37,19 @@ if($globaldata){
36
 
37
  $json = json_decode($globaldata);
38
 
39
- require_once(dirname(__FILE__) . '/inc/json.auth.php');
 
 
 
 
 
 
 
 
 
40
  global $gmAuth;
41
  $gmAuth = new Gmedia_JSON_API_Auth_Controller();
42
 
43
- if(isset($json->counter)){
44
- gmedia_ios_app_counters($json->counter);
45
- }
46
-
47
  if(isset($json->cookie) && !empty($json->cookie)){
48
  if(empty($gmedia_options['mobile_app'])){
49
  $out['error'] = array('code' => 'app_inactive', 'message' => 'Service not enabled/activated for this site');
@@ -184,7 +190,7 @@ function gmedia_ios_app_login($json){
184
  * @return array
185
  */
186
  function gmedia_ios_app_library_data($data = array('site', 'authors', 'filter', 'gmedia_category', 'gmedia_album', 'gmedia_tag'), $args = array()){
187
- global $user_ID, $wpdb, $gmDB, $gmGallery, $gmapp_version;
188
 
189
  if(null === $data){
190
  $data = array('site', 'authors', 'filter', 'gmedia_category', 'gmedia_album', 'gmedia_tag');
@@ -195,7 +201,11 @@ function gmedia_ios_app_library_data($data = array('site', 'authors', 'filter',
195
  if(version_compare('3.1', $gmapp_version, '<')){
196
  $logic = 3;
197
  }
198
- $terms_per_page = 40;
 
 
 
 
199
  } else{
200
  $logic = 1;
201
  $terms_per_page = '';
@@ -550,7 +560,7 @@ function gmedia_object_to_array($obj) {
550
  * @return array
551
  */
552
  function gmedia_ios_app_processor($action, $data, $filter = true){
553
- global $gmCore, $gmDB, $gmGallery, $user_ID, $gmapp_version;
554
 
555
  $out = array();
556
 
@@ -988,6 +998,10 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
988
  'status' => null
989
  );
990
 
 
 
 
 
991
  $terms_ids_query = array();
992
  if(!empty($data['tag__in'])){
993
  $tag_ids = wp_parse_id_list($data['tag__in']);
@@ -1146,17 +1160,17 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
1146
  }
1147
  $gmedias[ $i ]->albums = $albums;
1148
 
1149
- if('image' == $type[0]){
1150
- $terms = $gmDB->get_the_gmedia_terms($item->ID, 'gmedia_category');
1151
- $categories = array();
1152
- if($terms){
1153
- $terms = array_values((array)$terms);
1154
- foreach($terms as $term){
1155
- $categories[] = array('term_id' => $term->term_id, 'name' => $term->term_id, 'title' => $term->name);
1156
- }
1157
- }
1158
- $gmedias[ $i ]->categories = $categories;
1159
 
 
1160
  $gmedias[ $i ]->meta = array('thumb' => $_metadata['thumb'],
1161
  'web' => $_metadata['web'],
1162
  'original' => $_metadata['original']
16
  die();
17
  }
18
 
19
+ global $gmCore, $gmapp_version, $gmmodule;
20
  $gmapp_version = isset($_GET['gmappversion'])? $_GET['gmappversion'] : 1;
21
+ $gmmodule = isset($_GET['gmmodule'])? (int) $_GET['gmmodule'] : 0;
22
 
23
  $out = array();
24
 
37
 
38
  $json = json_decode($globaldata);
39
 
40
+ if(isset($json->counter)){
41
+ gmedia_ios_app_counters($json->counter);
42
+ $out['alert'] = array('title' => 'Success', 'message' => "\nCounters updated");
43
+ header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
44
+ header('Access-Control-Allow-Origin: *');
45
+ echo json_encode($out);
46
+ die();
47
+ }
48
+
49
+ require_once(dirname(__FILE__) . '/inc/json.auth.php');
50
  global $gmAuth;
51
  $gmAuth = new Gmedia_JSON_API_Auth_Controller();
52
 
 
 
 
 
53
  if(isset($json->cookie) && !empty($json->cookie)){
54
  if(empty($gmedia_options['mobile_app'])){
55
  $out['error'] = array('code' => 'app_inactive', 'message' => 'Service not enabled/activated for this site');
190
  * @return array
191
  */
192
  function gmedia_ios_app_library_data($data = array('site', 'authors', 'filter', 'gmedia_category', 'gmedia_album', 'gmedia_tag'), $args = array()){
193
+ global $user_ID, $wpdb, $gmDB, $gmGallery, $gmapp_version, $gmmodule;
194
 
195
  if(null === $data){
196
  $data = array('site', 'authors', 'filter', 'gmedia_category', 'gmedia_album', 'gmedia_tag');
201
  if(version_compare('3.1', $gmapp_version, '<')){
202
  $logic = 3;
203
  }
204
+ if($gmmodule){
205
+ $terms_per_page = '';
206
+ } else {
207
+ $terms_per_page = 40;
208
+ }
209
  } else{
210
  $logic = 1;
211
  $terms_per_page = '';
560
  * @return array
561
  */
562
  function gmedia_ios_app_processor($action, $data, $filter = true){
563
+ global $gmCore, $gmDB, $gmGallery, $user_ID, $gmapp_version, $gmmodule;
564
 
565
  $out = array();
566
 
998
  'status' => null
999
  );
1000
 
1001
+ if($gmmodule) {
1002
+ $args['per_page'] = -1;
1003
+ }
1004
+
1005
  $terms_ids_query = array();
1006
  if(!empty($data['tag__in'])){
1007
  $tag_ids = wp_parse_id_list($data['tag__in']);
1160
  }
1161
  $gmedias[ $i ]->albums = $albums;
1162
 
1163
+ $terms = $gmDB->get_the_gmedia_terms($item->ID, 'gmedia_category');
1164
+ $categories = array();
1165
+ if($terms){
1166
+ $terms = array_values((array)$terms);
1167
+ foreach($terms as $term){
1168
+ $categories[] = array('term_id' => $term->term_id, 'name' => $term->term_id, 'title' => $term->name);
1169
+ }
1170
+ }
1171
+ $gmedias[ $i ]->categories = $categories;
 
1172
 
1173
+ if('image' == $type[0]){
1174
  $gmedias[ $i ]->meta = array('thumb' => $_metadata['thumb'],
1175
  'web' => $_metadata['web'],
1176
  'original' => $_metadata['original']
assets/bootstrap-datetimepicker/bootstrap-datetimepicker.css CHANGED
@@ -1,204 +1,374 @@
1
  /*!
2
- * Datetimepicker for Bootstrap v3
 
3
  * https://github.com/Eonasdan/bootstrap-datetimepicker/
4
  */
5
  .bootstrap-datetimepicker-widget {
6
- top: 0;
7
- left: 0;
8
- width: 250px;
 
 
9
  padding: 4px;
10
- margin-top: 1px;
11
- z-index: 99999 !important;
12
- border-radius: 4px;
 
 
 
13
  }
14
- .bootstrap-datetimepicker-widget.timepicker-sbs {
15
- width: 600px;
 
 
16
  }
17
- .bootstrap-datetimepicker-widget.bottom:before {
 
 
 
 
 
 
18
  content: '';
19
  display: inline-block;
 
 
 
20
  border-left: 7px solid transparent;
21
  border-right: 7px solid transparent;
22
  border-bottom: 7px solid #ccc;
23
  border-bottom-color: rgba(0, 0, 0, 0.2);
24
- position: absolute;
25
  top: -7px;
26
  left: 7px;
27
  }
28
- .bootstrap-datetimepicker-widget.bottom:after {
29
- content: '';
30
- display: inline-block;
31
  border-left: 6px solid transparent;
32
  border-right: 6px solid transparent;
33
  border-bottom: 6px solid white;
34
- position: absolute;
35
  top: -6px;
36
  left: 8px;
37
  }
38
- .bootstrap-datetimepicker-widget.top:before {
39
- content: '';
40
- display: inline-block;
41
  border-left: 7px solid transparent;
42
  border-right: 7px solid transparent;
43
  border-top: 7px solid #ccc;
44
  border-top-color: rgba(0, 0, 0, 0.2);
45
- position: absolute;
46
  bottom: -7px;
47
  left: 6px;
48
  }
49
- .bootstrap-datetimepicker-widget.top:after {
50
- content: '';
51
- display: inline-block;
52
  border-left: 6px solid transparent;
53
  border-right: 6px solid transparent;
54
  border-top: 6px solid white;
55
- position: absolute;
56
  bottom: -6px;
57
  left: 7px;
58
  }
59
- .bootstrap-datetimepicker-widget .dow {
60
- width: 14.2857%;
61
- }
62
- .bootstrap-datetimepicker-widget.pull-right:before {
63
  left: auto;
64
  right: 6px;
65
  }
66
- .bootstrap-datetimepicker-widget.pull-right:after {
67
  left: auto;
68
  right: 7px;
69
  }
70
- .bootstrap-datetimepicker-widget > ul {
71
- list-style-type: none;
72
  margin: 0;
73
  }
 
 
 
 
 
 
74
  .bootstrap-datetimepicker-widget .timepicker-hour,
75
  .bootstrap-datetimepicker-widget .timepicker-minute,
76
  .bootstrap-datetimepicker-widget .timepicker-second {
77
- width: 100%;
78
  font-weight: bold;
79
  font-size: 1.2em;
 
 
 
 
80
  }
81
- .bootstrap-datetimepicker-widget table[data-hour-format="12"] .separator {
82
- width: 4px;
 
 
 
83
  padding: 0;
84
- margin: 0;
 
 
 
85
  }
86
- .bootstrap-datetimepicker-widget .datepicker > div {
87
- display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  }
89
  .bootstrap-datetimepicker-widget .picker-switch {
90
  text-align: center;
91
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  .bootstrap-datetimepicker-widget table {
93
  width: 100%;
94
  margin: 0;
95
  }
96
- .bootstrap-datetimepicker-widget td,
97
- .bootstrap-datetimepicker-widget th {
98
  text-align: center;
 
 
 
 
 
99
  width: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  height: 20px;
101
- border-radius: 4px;
 
102
  }
103
- .bootstrap-datetimepicker-widget td.day:hover,
104
- .bootstrap-datetimepicker-widget td.hour:hover,
105
- .bootstrap-datetimepicker-widget td.minute:hover,
106
- .bootstrap-datetimepicker-widget td.second:hover {
 
 
 
 
 
107
  background: #eeeeee;
108
  cursor: pointer;
109
  }
110
- .bootstrap-datetimepicker-widget td.old,
111
- .bootstrap-datetimepicker-widget td.new {
112
- color: #999999;
113
  }
114
- .bootstrap-datetimepicker-widget td.today {
115
  position: relative;
116
  }
117
- .bootstrap-datetimepicker-widget td.today:before {
118
  content: '';
119
  display: inline-block;
120
- border-left: 7px solid transparent;
121
- border-bottom: 7px solid #428bca;
 
122
  border-top-color: rgba(0, 0, 0, 0.2);
123
  position: absolute;
124
  bottom: 4px;
125
  right: 4px;
126
  }
127
- .bootstrap-datetimepicker-widget td.active,
128
- .bootstrap-datetimepicker-widget td.active:hover {
129
- background-color: #428bca;
130
  color: #fff;
131
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
132
  }
133
- .bootstrap-datetimepicker-widget td.active.today:before {
134
  border-bottom-color: #fff;
135
  }
136
- .bootstrap-datetimepicker-widget td.disabled,
137
- .bootstrap-datetimepicker-widget td.disabled:hover {
138
  background: none;
139
- color: #999999;
140
  cursor: not-allowed;
141
  }
142
- .bootstrap-datetimepicker-widget td span {
143
- display: block;
144
- width: 47px;
145
  height: 54px;
146
  line-height: 54px;
147
- float: left;
148
- margin: 2px;
149
  cursor: pointer;
150
  border-radius: 4px;
151
  }
152
- .bootstrap-datetimepicker-widget td span:hover {
153
  background: #eeeeee;
154
  }
155
- .bootstrap-datetimepicker-widget td span.active {
156
- background-color: #428bca;
157
  color: #fff;
158
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
159
  }
160
- .bootstrap-datetimepicker-widget td span.old {
161
- color: #999999;
162
  }
163
- .bootstrap-datetimepicker-widget td span.disabled,
164
- .bootstrap-datetimepicker-widget td span.disabled:hover {
165
  background: none;
166
- color: #999999;
167
  cursor: not-allowed;
168
  }
169
- .bootstrap-datetimepicker-widget th.switch {
170
- width: 145px;
 
171
  }
172
- .bootstrap-datetimepicker-widget th.next,
173
- .bootstrap-datetimepicker-widget th.prev {
174
- font-size: 21px;
175
  }
176
- .bootstrap-datetimepicker-widget th.disabled,
177
- .bootstrap-datetimepicker-widget th.disabled:hover {
178
- background: none;
179
- color: #999999;
180
- cursor: not-allowed;
181
  }
182
- .bootstrap-datetimepicker-widget thead tr:first-child th {
183
  cursor: pointer;
184
  }
185
- .bootstrap-datetimepicker-widget thead tr:first-child th:hover {
186
- background: #eeeeee;
187
- }
188
- .input-group.date .input-group-addon span {
189
- display: block;
190
- cursor: pointer;
191
- width: 16px;
192
- height: 16px;
193
- }
194
- .bootstrap-datetimepicker-widget.left-oriented:before {
195
- left: auto;
196
- right: 6px;
197
- }
198
- .bootstrap-datetimepicker-widget.left-oriented:after {
199
- left: auto;
200
- right: 7px;
201
- }
202
- .bootstrap-datetimepicker-widget ul.list-unstyled li div.timepicker div.timepicker-picker table.table-condensed tbody > tr > td {
203
- padding: 0px !important;
204
  }
1
  /*!
2
+ * Datetimepicker for Bootstrap 3
3
+ * version : 4.17.47
4
  * https://github.com/Eonasdan/bootstrap-datetimepicker/
5
  */
6
  .bootstrap-datetimepicker-widget {
7
+ list-style: none;
8
+ }
9
+ .bootstrap-datetimepicker-widget.dropdown-menu {
10
+ display: block;
11
+ margin: 2px 0;
12
  padding: 4px;
13
+ width: 19em;
14
+ }
15
+ @media (min-width: 768px) {
16
+ .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
17
+ width: 38em;
18
+ }
19
  }
20
+ @media (min-width: 992px) {
21
+ .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
22
+ width: 38em;
23
+ }
24
  }
25
+ @media (min-width: 1200px) {
26
+ .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
27
+ width: 38em;
28
+ }
29
+ }
30
+ .bootstrap-datetimepicker-widget.dropdown-menu:before,
31
+ .bootstrap-datetimepicker-widget.dropdown-menu:after {
32
  content: '';
33
  display: inline-block;
34
+ position: absolute;
35
+ }
36
+ .bootstrap-datetimepicker-widget.dropdown-menu.bottom:before {
37
  border-left: 7px solid transparent;
38
  border-right: 7px solid transparent;
39
  border-bottom: 7px solid #ccc;
40
  border-bottom-color: rgba(0, 0, 0, 0.2);
 
41
  top: -7px;
42
  left: 7px;
43
  }
44
+ .bootstrap-datetimepicker-widget.dropdown-menu.bottom:after {
 
 
45
  border-left: 6px solid transparent;
46
  border-right: 6px solid transparent;
47
  border-bottom: 6px solid white;
 
48
  top: -6px;
49
  left: 8px;
50
  }
51
+ .bootstrap-datetimepicker-widget.dropdown-menu.top:before {
 
 
52
  border-left: 7px solid transparent;
53
  border-right: 7px solid transparent;
54
  border-top: 7px solid #ccc;
55
  border-top-color: rgba(0, 0, 0, 0.2);
 
56
  bottom: -7px;
57
  left: 6px;
58
  }
59
+ .bootstrap-datetimepicker-widget.dropdown-menu.top:after {
 
 
60
  border-left: 6px solid transparent;
61
  border-right: 6px solid transparent;
62
  border-top: 6px solid white;
 
63
  bottom: -6px;
64
  left: 7px;
65
  }
66
+ .bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before {
 
 
 
67
  left: auto;
68
  right: 6px;
69
  }
70
+ .bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after {
71
  left: auto;
72
  right: 7px;
73
  }
74
+ .bootstrap-datetimepicker-widget .list-unstyled {
 
75
  margin: 0;
76
  }
77
+ .bootstrap-datetimepicker-widget a[data-action] {
78
+ padding: 6px 0;
79
+ }
80
+ .bootstrap-datetimepicker-widget a[data-action]:active {
81
+ box-shadow: none;
82
+ }
83
  .bootstrap-datetimepicker-widget .timepicker-hour,
84
  .bootstrap-datetimepicker-widget .timepicker-minute,
85
  .bootstrap-datetimepicker-widget .timepicker-second {
86
+ width: 54px;
87
  font-weight: bold;
88
  font-size: 1.2em;
89
+ margin: 0;
90
+ }
91
+ .bootstrap-datetimepicker-widget button[data-action] {
92
+ padding: 6px;
93
  }
94
+ .bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after {
95
+ position: absolute;
96
+ width: 1px;
97
+ height: 1px;
98
+ margin: -1px;
99
  padding: 0;
100
+ overflow: hidden;
101
+ clip: rect(0, 0, 0, 0);
102
+ border: 0;
103
+ content: "Increment Hours";
104
  }
105
+ .bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after {
106
+ position: absolute;
107
+ width: 1px;
108
+ height: 1px;
109
+ margin: -1px;
110
+ padding: 0;
111
+ overflow: hidden;
112
+ clip: rect(0, 0, 0, 0);
113
+ border: 0;
114
+ content: "Increment Minutes";
115
+ }
116
+ .bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after {
117
+ position: absolute;
118
+ width: 1px;
119
+ height: 1px;
120
+ margin: -1px;
121
+ padding: 0;
122
+ overflow: hidden;
123
+ clip: rect(0, 0, 0, 0);
124
+ border: 0;
125
+ content: "Decrement Hours";
126
+ }
127
+ .bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after {
128
+ position: absolute;
129
+ width: 1px;
130
+ height: 1px;
131
+ margin: -1px;
132
+ padding: 0;
133
+ overflow: hidden;
134
+ clip: rect(0, 0, 0, 0);
135
+ border: 0;
136
+ content: "Decrement Minutes";
137
+ }
138
+ .bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after {
139
+ position: absolute;
140
+ width: 1px;
141
+ height: 1px;
142
+ margin: -1px;
143
+ padding: 0;
144
+ overflow: hidden;
145
+ clip: rect(0, 0, 0, 0);
146
+ border: 0;
147
+ content: "Show Hours";
148
+ }
149
+ .bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after {
150
+ position: absolute;
151
+ width: 1px;
152
+ height: 1px;
153
+ margin: -1px;
154
+ padding: 0;
155
+ overflow: hidden;
156
+ clip: rect(0, 0, 0, 0);
157
+ border: 0;
158
+ content: "Show Minutes";
159
+ }
160
+ .bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after {
161
+ position: absolute;
162
+ width: 1px;
163
+ height: 1px;
164
+ margin: -1px;
165
+ padding: 0;
166
+ overflow: hidden;
167
+ clip: rect(0, 0, 0, 0);
168
+ border: 0;
169
+ content: "Toggle AM/PM";
170
+ }
171
+ .bootstrap-datetimepicker-widget .btn[data-action="clear"]::after {
172
+ position: absolute;
173
+ width: 1px;
174
+ height: 1px;
175
+ margin: -1px;
176
+ padding: 0;
177
+ overflow: hidden;
178
+ clip: rect(0, 0, 0, 0);
179
+ border: 0;
180
+ content: "Clear the picker";
181
+ }
182
+ .bootstrap-datetimepicker-widget .btn[data-action="today"]::after {
183
+ position: absolute;
184
+ width: 1px;
185
+ height: 1px;
186
+ margin: -1px;
187
+ padding: 0;
188
+ overflow: hidden;
189
+ clip: rect(0, 0, 0, 0);
190
+ border: 0;
191
+ content: "Set the date to today";
192
  }
193
  .bootstrap-datetimepicker-widget .picker-switch {
194
  text-align: center;
195
  }
196
+ .bootstrap-datetimepicker-widget .picker-switch::after {
197
+ position: absolute;
198
+ width: 1px;
199
+ height: 1px;
200
+ margin: -1px;
201
+ padding: 0;
202
+ overflow: hidden;
203
+ clip: rect(0, 0, 0, 0);
204
+ border: 0;
205
+ content: "Toggle Date and Time Screens";
206
+ }
207
+ .bootstrap-datetimepicker-widget .picker-switch td {
208
+ padding: 0;
209
+ margin: 0;
210
+ height: auto;
211
+ width: auto;
212
+ line-height: inherit;
213
+ }
214
+ .bootstrap-datetimepicker-widget .picker-switch td span {
215
+ line-height: 2.5;
216
+ height: 2.5em;
217
+ width: 100%;
218
+ }
219
  .bootstrap-datetimepicker-widget table {
220
  width: 100%;
221
  margin: 0;
222
  }
223
+ .bootstrap-datetimepicker-widget table td,
224
+ .bootstrap-datetimepicker-widget table th {
225
  text-align: center;
226
+ border-radius: 4px;
227
+ }
228
+ .bootstrap-datetimepicker-widget table th {
229
+ height: 20px;
230
+ line-height: 20px;
231
  width: 20px;
232
+ }
233
+ .bootstrap-datetimepicker-widget table th.picker-switch {
234
+ width: 145px;
235
+ }
236
+ .bootstrap-datetimepicker-widget table th.disabled,
237
+ .bootstrap-datetimepicker-widget table th.disabled:hover {
238
+ background: none;
239
+ color: #777777;
240
+ cursor: not-allowed;
241
+ }
242
+ .bootstrap-datetimepicker-widget table th.prev::after {
243
+ position: absolute;
244
+ width: 1px;
245
+ height: 1px;
246
+ margin: -1px;
247
+ padding: 0;
248
+ overflow: hidden;
249
+ clip: rect(0, 0, 0, 0);
250
+ border: 0;
251
+ content: "Previous Month";
252
+ }
253
+ .bootstrap-datetimepicker-widget table th.next::after {
254
+ position: absolute;
255
+ width: 1px;
256
+ height: 1px;
257
+ margin: -1px;
258
+ padding: 0;
259
+ overflow: hidden;
260
+ clip: rect(0, 0, 0, 0);
261
+ border: 0;
262
+ content: "Next Month";
263
+ }
264
+ .bootstrap-datetimepicker-widget table thead tr:first-child th {
265
+ cursor: pointer;
266
+ }
267
+ .bootstrap-datetimepicker-widget table thead tr:first-child th:hover {
268
+ background: #eeeeee;
269
+ }
270
+ .bootstrap-datetimepicker-widget table td {
271
+ height: 54px;
272
+ line-height: 54px;
273
+ width: 54px;
274
+ }
275
+ .bootstrap-datetimepicker-widget table td.cw {
276
+ font-size: .8em;
277
  height: 20px;
278
+ line-height: 20px;
279
+ color: #777777;
280
  }
281
+ .bootstrap-datetimepicker-widget table td.day {
282
+ height: 20px;
283
+ line-height: 20px;
284
+ width: 20px;
285
+ }
286
+ .bootstrap-datetimepicker-widget table td.day:hover,
287
+ .bootstrap-datetimepicker-widget table td.hour:hover,
288
+ .bootstrap-datetimepicker-widget table td.minute:hover,
289
+ .bootstrap-datetimepicker-widget table td.second:hover {
290
  background: #eeeeee;
291
  cursor: pointer;
292
  }
293
+ .bootstrap-datetimepicker-widget table td.old,
294
+ .bootstrap-datetimepicker-widget table td.new {
295
+ color: #777777;
296
  }
297
+ .bootstrap-datetimepicker-widget table td.today {
298
  position: relative;
299
  }
300
+ .bootstrap-datetimepicker-widget table td.today:before {
301
  content: '';
302
  display: inline-block;
303
+ border: solid transparent;
304
+ border-width: 0 0 7px 7px;
305
+ border-bottom-color: #337ab7;
306
  border-top-color: rgba(0, 0, 0, 0.2);
307
  position: absolute;
308
  bottom: 4px;
309
  right: 4px;
310
  }
311
+ .bootstrap-datetimepicker-widget table td.active,
312
+ .bootstrap-datetimepicker-widget table td.active:hover {
313
+ background-color: #337ab7;
314
  color: #fff;
315
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
316
  }
317
+ .bootstrap-datetimepicker-widget table td.active.today:before {
318
  border-bottom-color: #fff;
319
  }
320
+ .bootstrap-datetimepicker-widget table td.disabled,
321
+ .bootstrap-datetimepicker-widget table td.disabled:hover {
322
  background: none;
323
+ color: #777777;
324
  cursor: not-allowed;
325
  }
326
+ .bootstrap-datetimepicker-widget table td span {
327
+ display: inline-block;
328
+ width: 54px;
329
  height: 54px;
330
  line-height: 54px;
331
+ margin: 2px 1.5px;
 
332
  cursor: pointer;
333
  border-radius: 4px;
334
  }
335
+ .bootstrap-datetimepicker-widget table td span:hover {
336
  background: #eeeeee;
337
  }
338
+ .bootstrap-datetimepicker-widget table td span.active {
339
+ background-color: #337ab7;
340
  color: #fff;
341
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
342
  }
343
+ .bootstrap-datetimepicker-widget table td span.old {
344
+ color: #777777;
345
  }
346
+ .bootstrap-datetimepicker-widget table td span.disabled,
347
+ .bootstrap-datetimepicker-widget table td span.disabled:hover {
348
  background: none;
349
+ color: #777777;
350
  cursor: not-allowed;
351
  }
352
+ .bootstrap-datetimepicker-widget.usetwentyfour td.hour {
353
+ height: 27px;
354
+ line-height: 27px;
355
  }
356
+ .bootstrap-datetimepicker-widget.wider {
357
+ width: 21em;
 
358
  }
359
+ .bootstrap-datetimepicker-widget .datepicker-decades .decade {
360
+ line-height: 1.8em !important;
 
 
 
361
  }
362
+ .input-group.date .input-group-addon {
363
  cursor: pointer;
364
  }
365
+ .sr-only {
366
+ position: absolute;
367
+ width: 1px;
368
+ height: 1px;
369
+ margin: -1px;
370
+ padding: 0;
371
+ overflow: hidden;
372
+ clip: rect(0, 0, 0, 0);
373
+ border: 0;
 
 
 
 
 
 
 
 
 
 
374
  }
assets/bootstrap-datetimepicker/bootstrap-datetimepicker.js CHANGED
@@ -1,1160 +1,2636 @@
 
 
 
 
 
 
 
1
  /*
2
- Version 3.0.0
3
- =========================================================
4
- bootstrap-datetimepicker.js
5
- https://github.com/Eonasdan/bootstrap-datetimepicker
6
- =========================================================
7
- The MIT License (MIT)
8
-
9
- Copyright (c) 2014 Jonathan Peterson
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in
19
- all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
- THE SOFTWARE.
28
- */
29
- ; (function (factory) {
 
30
  if (typeof define === 'function' && define.amd) {
31
  // AMD is used - Register as an anonymous module.
32
  define(['jquery', 'moment'], factory);
 
 
33
  } else {
34
- // AMD is not used - Attempt to fetch dependencies from scope.
35
- if (!jQuery) {
36
  throw 'bootstrap-datetimepicker requires jQuery to be loaded first';
37
- } else if (!moment) {
38
- throw 'bootstrap-datetimepicker requires moment.js to be loaded first';
39
- } else {
40
- factory(jQuery, moment);
41
  }
 
 
 
 
 
 
 
 
 
42
  }
43
- }
44
 
45
- (function ($, moment) {
46
- if (typeof moment === 'undefined') {
47
- alert("momentjs is requried");
48
- throw new Error('momentjs is required');
49
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
 
51
- var dpgId = 0,
52
-
53
- pMoment = moment,
54
-
55
- // ReSharper disable once InconsistentNaming
56
- DateTimePicker = function (element, options) {
57
- var defaults = {
58
- pickDate: true,
59
- pickTime: true,
60
- useMinutes: true,
61
- useSeconds: false,
62
- useCurrent: true,
63
- minuteStepping: 1,
64
- minDate: new pMoment({ y: 1900 }),
65
- maxDate: new pMoment().add(100, "y"),
66
- showToday: true,
67
- collapse: true,
68
- language: "en",
69
- defaultDate: "",
70
- disabledDates: false,
71
- enabledDates: false,
72
- icons: {},
73
- useStrict: false,
74
- direction: "auto",
75
- sideBySide: false,
76
- daysOfWeekDisabled: false
77
- },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
 
79
- icons = {
80
- time: 'glyphicon glyphicon-time',
81
- date: 'glyphicon glyphicon-calendar',
82
- up: 'glyphicon glyphicon-chevron-up',
83
- down: 'glyphicon glyphicon-chevron-down'
84
- },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
 
86
- picker = this,
 
 
87
 
88
- init = function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
89
 
90
- var icon = false, i, dDate, longDateFormat;
91
- picker.options = $.extend({}, defaults, options);
92
- picker.options.icons = $.extend({}, icons, picker.options.icons);
 
 
 
 
 
 
 
 
 
 
 
93
 
94
- picker.element = $(element);
 
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
- dataToOptions();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
- if (!(picker.options.pickTime || picker.options.pickDate))
99
- throw new Error('Must choose at least one picker');
 
 
 
 
100
 
101
- picker.id = dpgId++;
102
- pMoment.lang(picker.options.language);
103
- picker.date = pMoment();
104
- picker.unset = false;
105
- picker.isInput = picker.element.is('input');
106
- picker.component = false;
107
 
108
- if (picker.element.hasClass('input-group')) {
109
- if (picker.element.find('.datepickerbutton').size() == 0) {//in case there is more then one 'input-group-addon' Issue #48
110
- picker.component = picker.element.find("[class^='input-group-']");
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  }
112
- else {
113
- picker.component = picker.element.find('.datepickerbutton');
 
114
  }
 
115
  }
116
- picker.format = picker.options.format;
 
 
117
 
118
- longDateFormat = pMoment()._lang._longDateFormat;
 
 
 
119
 
120
- if (!picker.format) {
121
- picker.format = (picker.options.pickDate ? longDateFormat.L : '');
122
- if (picker.options.pickDate && picker.options.pickTime) picker.format += ' ';
123
- picker.format += (picker.options.pickTime ? longDateFormat.LT : '');
124
- if (picker.options.useSeconds) {
125
- if (~longDateFormat.LT.indexOf(' A')) {
126
- picker.format = picker.format.split(" A")[0] + ":ss A";
127
- }
128
- else {
129
- picker.format += ':ss';
130
- }
131
- }
132
  }
133
- picker.use24hours = picker.format.toLowerCase().indexOf("a") < 1;
134
 
135
- if (picker.component) icon = picker.component.find('span');
 
 
 
136
 
137
- if (picker.options.pickTime) {
138
- if (icon) icon.addClass(picker.options.icons.time);
 
139
  }
140
- if (picker.options.pickDate) {
141
- if (icon) {
142
- icon.removeClass(picker.options.icons.time);
143
- icon.addClass(picker.options.icons.date);
144
- }
145
  }
146
 
147
- picker.widget = $(getTemplate()).appendTo('body');
 
 
 
 
 
 
148
 
149
- if (picker.options.useSeconds && !picker.use24hours) {
150
- picker.widget.width(300);
 
151
  }
152
 
153
- picker.minViewMode = picker.options.minViewMode || 0;
154
- if (typeof picker.minViewMode === 'string') {
155
- switch (picker.minViewMode) {
156
- case 'months':
157
- picker.minViewMode = 1;
158
- break;
159
- case 'years':
160
- picker.minViewMode = 2;
161
- break;
162
- default:
163
- picker.minViewMode = 0;
164
- break;
165
- }
166
- }
167
- picker.viewMode = picker.options.viewMode || 0;
168
- if (typeof picker.viewMode === 'string') {
169
- switch (picker.viewMode) {
170
- case 'months':
171
- picker.viewMode = 1;
172
- break;
173
- case 'years':
174
- picker.viewMode = 2;
175
- break;
176
- default:
177
- picker.viewMode = 0;
178
- break;
179
- }
180
  }
181
 
182
- picker.options.disabledDates = indexGivenDates(picker.options.disabledDates);
183
- picker.options.enabledDates = indexGivenDates(picker.options.enabledDates);
 
 
 
 
 
184
 
185
- picker.startViewMode = picker.viewMode;
186
- picker.setMinDate(picker.options.minDate);
187
- picker.setMaxDate(picker.options.maxDate);
188
- fillDow();
189
- fillMonths();
190
- fillHours();
191
- fillMinutes();
192
- fillSeconds();
193
- update();
194
- showMode();
195
- attachDatePickerEvents();
196
- if (picker.options.defaultDate !== "" && getPickerInput().val() == "") picker.setValue(picker.options.defaultDate);
197
- if (picker.options.minuteStepping !== 1) {
198
- var rMinutes = picker.date.minutes();
199
- var rInterval = picker.options.minuteStepping;
200
- picker.date.minutes((Math.round(rMinutes / rInterval) * rInterval) % 60)
201
- .seconds(0);
202
  }
203
- },
204
 
205
- getPickerInput = function () {
206
- if (picker.isInput) {
207
- return picker.element;
208
- } else {
209
- return dateStr = picker.element.find('input');
210
  }
211
- },
212
 
213
- dataToOptions = function () {
214
- var eData
215
- if (picker.element.is('input')) {
216
- eData = picker.element.data();
217
- }
218
- else {
219
- eData = picker.element.data();
220
- }
221
- if (eData.dateFormat !== undefined) picker.options.format = eData.dateFormat;
222
- if (eData.datePickdate !== undefined) picker.options.pickDate = eData.datePickdate;
223
- if (eData.datePicktime !== undefined) picker.options.pickTime = eData.datePicktime;
224
- if (eData.dateUseminutes !== undefined) picker.options.useMinutes = eData.dateUseminutes;
225
- if (eData.dateUseseconds !== undefined) picker.options.useSeconds = eData.dateUseseconds;
226
- if (eData.dateUsecurrent !== undefined) picker.options.useCurrent = eData.dateUsecurrent;
227
- if (eData.dateMinutestepping !== undefined) picker.options.minuteStepping = eData.dateMinutestepping;
228
- if (eData.dateMindate !== undefined) picker.options.minDate = eData.dateMindate;
229
- if (eData.dateMaxdate !== undefined) picker.options.maxDate = eData.dateMaxdate;
230
- if (eData.dateShowtoday !== undefined) picker.options.showToday = eData.dateShowtoday;
231
- if (eData.dateCollapse !== undefined) picker.options.collapse = eData.dateCollapse;
232
- if (eData.dateLanguage !== undefined) picker.options.language = eData.dateLanguage;
233
- if (eData.dateDefaultdate !== undefined) picker.options.defaultDate = eData.dateDefaultdate;
234
- if (eData.dateDisableddates !== undefined) picker.options.disabledDates = eData.dateDisableddates;
235
- if (eData.dateEnableddates !== undefined) picker.options.enabledDates = eData.dateEnableddates;
236
- if (eData.dateIcons !== undefined) picker.options.icons = eData.dateIcons;
237
- if (eData.dateUsestrict !== undefined) picker.options.useStrict = eData.dateUsestrict;
238
- if (eData.dateDirection !== undefined) picker.options.direction = eData.dateDirection;
239
- if (eData.dateSidebyside !== undefined) picker.options.sideBySide = eData.dateSidebyside;
240
- },
241
 
242
- place = function () {
243
- var position = 'absolute',
244
- offset = picker.component ? picker.component.offset() : picker.element.offset(), $window = $(window);
245
- picker.width = picker.component ? picker.component.outerWidth() : picker.element.outerWidth();
246
- offset.top = offset.top + picker.element.outerHeight();
247
-
248
- var placePosition;
249
- if (picker.options.direction === 'up') {
250
- placePosition = 'top'
251
- } else if (picker.options.direction === 'bottom') {
252
- placePosition = 'bottom'
253
- } else if (picker.options.direction === 'auto') {
254
- if (offset.top + picker.widget.height() > $window.height() + $window.scrollTop() && picker.widget.height() + picker.element.outerHeight() < offset.top) {
255
- placePosition = 'top';
256
- } else {
257
- placePosition = 'bottom';
258
- }
259
- };
260
- if (placePosition === 'top') {
261
- offset.top -= picker.widget.height() + picker.element.outerHeight() + 15;
262
- picker.widget.addClass('top').removeClass('bottom');
263
- } else {
264
- offset.top += 1;
265
- picker.widget.addClass('bottom').removeClass('top');
266
  }
 
 
267
 
268
- if (picker.options.width !== undefined) {
269
- picker.widget.width(picker.options.width);
 
270
  }
271
 
272
- if (picker.options.orientation === 'left') {
273
- picker.widget.addClass('left-oriented');
274
- offset.left = offset.left - picker.widget.width() + 20;
275
  }
276
 
277
- if (isInFixed()) {
278
- position = 'fixed';
279
- offset.top -= $window.scrollTop();
280
- offset.left -= $window.scrollLeft();
 
 
 
281
  }
282
 
283
- if ($window.width() < offset.left + picker.widget.outerWidth()) {
284
- offset.right = $window.width() - offset.left - picker.width;
285
- offset.left = 'auto';
286
- picker.widget.addClass('pull-right');
287
- } else {
288
- offset.right = 'auto';
289
- picker.widget.removeClass('pull-right');
290
  }
291
 
292
- picker.widget.css({
293
- position: position,
294
- top: offset.top,
295
- left: offset.left,
296
- right: offset.right
297
- });
298
- },
299
 
300
- notifyChange = function (oldDate, eventType) {
301
- if (pMoment(picker.date).isSame(pMoment(oldDate))) return;
302
- picker.element.trigger({
303
- type: 'dp.change',
304
- date: pMoment(picker.date),
305
- oldDate: pMoment(oldDate)
306
- });
307
 
308
- if (eventType !== 'change')
309
- picker.element.change();
310
- },
311
 
312
- notifyError = function (date) {
313
- picker.element.trigger({
314
- type: 'dp.error',
315
- date: pMoment(date)
316
- });
317
- },
318
-
319
- update = function (newDate) {
320
- pMoment.lang(picker.options.language);
321
- var dateStr = newDate;
322
- if (!dateStr) {
323
- dateStr = getPickerInput().val()
324
- if (dateStr) picker.date = pMoment(dateStr, picker.format, picker.options.useStrict);
325
- if (!picker.date) picker.date = pMoment();
326
- }
327
- picker.viewDate = pMoment(picker.date).startOf("month");
328
- fillDate();
329
- fillTime();
330
- },
331
 
332
- fillDow = function () {
333
- pMoment.lang(picker.options.language);
334
- var html = $('<tr>'), weekdaysMin = pMoment.weekdaysMin(), i;
335
- if (pMoment()._lang._week.dow == 0) { // starts on Sunday
336
- for (i = 0; i < 7; i++) {
337
- html.append('<th class="dow">' + weekdaysMin[i] + '</th>');
338
- }
339
- } else {
340
- for (i = 1; i < 8; i++) {
341
- if (i == 7) {
342
- html.append('<th class="dow">' + weekdaysMin[0] + '</th>');
343
- } else {
344
- html.append('<th class="dow">' + weekdaysMin[i] + '</th>');
345
- }
346
- }
347
- }
348
- picker.widget.find('.datepicker-days thead').append(html);
349
- },
350
-
351
- fillMonths = function () {
352
- pMoment.lang(picker.options.language);
353
- var html = '', i = 0, monthsShort = pMoment.monthsShort();
354
- while (i < 12) {
355
- html += '<span class="month">' + monthsShort[i++] + '</span>';
356
- }
357
- picker.widget.find('.datepicker-months td').append(html);
358
- },
359
 
360
- fillDate = function () {
361
- pMoment.lang(picker.options.language);
362
- var year = picker.viewDate.year(),
363
- month = picker.viewDate.month(),
364
- startYear = picker.options.minDate.year(),
365
- startMonth = picker.options.minDate.month(),
366
- endYear = picker.options.maxDate.year(),
367
- endMonth = picker.options.maxDate.month(),
368
- prevMonth, nextMonth, html = [], row, clsName, i, days, yearCont, currentYear, months = pMoment.months();
369
 
370
- picker.widget.find('.datepicker-days').find('.disabled').removeClass('disabled');
371
- picker.widget.find('.datepicker-months').find('.disabled').removeClass('disabled');
372
- picker.widget.find('.datepicker-years').find('.disabled').removeClass('disabled');
373
 
374
- picker.widget.find('.datepicker-days th:eq(1)').text(
375
- months[month] + ' ' + year);
 
376
 
377
- prevMonth = pMoment(picker.viewDate).subtract("months", 1);
378
- days = prevMonth.daysInMonth();
379
- prevMonth.date(days).startOf('week');
380
- if ((year == startYear && month <= startMonth) || year < startYear) {
381
- picker.widget.find('.datepicker-days th:eq(0)').addClass('disabled');
382
- }
383
- if ((year == endYear && month >= endMonth) || year > endYear) {
384
- picker.widget.find('.datepicker-days th:eq(2)').addClass('disabled');
385
  }
386
 
387
- nextMonth = pMoment(prevMonth).add(42, "d");
388
- while (prevMonth.isBefore(nextMonth)) {
389
- if (prevMonth.weekday() === pMoment().startOf('week').weekday()) {
390
- row = $('<tr>');
391
- html.push(row);
392
- }
393
- clsName = '';
394
- if (prevMonth.year() < year || (prevMonth.year() == year && prevMonth.month() < month)) {
395
- clsName += ' old';
396
- } else if (prevMonth.year() > year || (prevMonth.year() == year && prevMonth.month() > month)) {
397
- clsName += ' new';
398
- }
399
- if (prevMonth.isSame(pMoment({ y: picker.date.year(), M: picker.date.month(), d: picker.date.date() }))) {
400
- clsName += ' active';
401
- }
402
- if (isInDisableDates(prevMonth) || !isInEnableDates(prevMonth)) {
403
- clsName += ' disabled';
404
- }
405
- if (picker.options.showToday === true) {
406
- if (prevMonth.isSame(pMoment(), 'day')) {
407
- clsName += ' today';
408
- }
409
- }
410
- if (picker.options.daysOfWeekDisabled) {
411
- for (i in picker.options.daysOfWeekDisabled) {
412
- if (prevMonth.day() == picker.options.daysOfWeekDisabled[i]) {
413
- clsName += ' disabled';
414
- break;
415
- }
416
- }
417
- }
418
- row.append('<td class="day' + clsName + '">' + prevMonth.date() + '</td>');
419
- prevMonth.add(1, "d");
420
- }
421
- picker.widget.find('.datepicker-days tbody').empty().append(html);
422
- currentYear = picker.date.year(), months = picker.widget.find('.datepicker-months')
423
- .find('th:eq(1)').text(year).end().find('span').removeClass('active');
424
- if (currentYear === year) {
425
- months.eq(picker.date.month()).addClass('active');
426
- }
427
- if (currentYear - 1 < startYear) {
428
- picker.widget.find('.datepicker-months th:eq(0)').addClass('disabled');
429
  }
430
- if (currentYear + 1 > endYear) {
431
- picker.widget.find('.datepicker-months th:eq(2)').addClass('disabled');
 
432
  }
433
- for (i = 0; i < 12; i++) {
434
- if ((year == startYear && startMonth > i) || (year < startYear)) {
435
- $(months[i]).addClass('disabled');
436
- } else if ((year == endYear && endMonth < i) || (year > endYear)) {
437
- $(months[i]).addClass('disabled');
438
- }
 
 
439
  }
440
 
441
- html = '';
442
- year = parseInt(year / 10, 10) * 10;
443
- yearCont = picker.widget.find('.datepicker-years').find(
444
- 'th:eq(1)').text(year + '-' + (year + 9)).end().find('td');
445
- picker.widget.find('.datepicker-years').find('th').removeClass('disabled');
446
- if (startYear > year) {
447
- picker.widget.find('.datepicker-years').find('th:eq(0)').addClass('disabled');
448
  }
449
- if (endYear < year + 9) {
450
- picker.widget.find('.datepicker-years').find('th:eq(2)').addClass('disabled');
 
 
 
 
 
 
451
  }
452
- year -= 1;
453
- for (i = -1; i < 11; i++) {
454
- html += '<span class="year' + (i === -1 || i === 10 ? ' old' : '') + (currentYear === year ? ' active' : '') + ((year < startYear || year > endYear) ? ' disabled' : '') + '">' + year + '</span>';
455
- year += 1;
456
  }
457
- yearCont.html(html);
458
- },
 
459
 
460
- fillHours = function () {
461
- pMoment.lang(picker.options.language);
462
- var table = picker.widget.find('.timepicker .timepicker-hours table'), html = '', current, i, j;
463
- table.parent().hide();
464
- if (picker.use24hours) {
465
- current = 0;
466
- for (i = 0; i < 6; i += 1) {
467
- html += '<tr>';
468
- for (j = 0; j < 4; j += 1) {
469
- html += '<td class="hour">' + padLeft(current.toString()) + '</td>';
470
- current++;
471
- }
472
- html += '</tr>';
473
- }
474
  }
475
- else {
476
- current = 1;
477
- for (i = 0; i < 3; i += 1) {
478
- html += '<tr>';
479
- for (j = 0; j < 4; j += 1) {
480
- html += '<td class="hour">' + padLeft(current.toString()) + '</td>';
481
- current++;
482
- }
483
- html += '</tr>';
484
- }
485
  }
486
- table.html(html);
487
- },
488
 
489
- fillMinutes = function () {
490
- var table = picker.widget.find('.timepicker .timepicker-minutes table'), html = '', current = 0, i, j, step = picker.options.minuteStepping;
491
- table.parent().hide();
492
- if (step = 1) step = 5;
493
- for (i = 0; i < Math.ceil(60 / step / 4) ; i++) {
494
- html += '<tr>';
495
- for (j = 0; j < 4; j += 1) {
496
- if (current < 60) {
497
- html += '<td class="minute">' + padLeft(current.toString()) + '</td>';
498
- current += step;
499
- } else {
500
- html += '<td></td>';
501
- }
502
- }
503
- html += '</tr>';
504
  }
505
- table.html(html);
506
- },
507
 
508
- fillSeconds = function () {
509
- var table = picker.widget.find('.timepicker .timepicker-seconds table'), html = '', current = 0, i, j;
510
- table.parent().hide();
511
- for (i = 0; i < 3; i++) {
512
- html += '<tr>';
513
- for (j = 0; j < 4; j += 1) {
514
- html += '<td class="second">' + padLeft(current.toString()) + '</td>';
515
- current += 5;
516
- }
517
- html += '</tr>';
518
  }
519
- table.html(html);
520
- },
521
 
522
- fillTime = function () {
523
- if (!picker.date) return;
524
- var timeComponents = picker.widget.find('.timepicker span[data-time-component]'),
525
- hour = picker.date.hours(),
526
- period = 'AM';
527
- if (!picker.use24hours) {
528
- if (hour >= 12) period = 'PM';
529
- if (hour === 0) hour = 12;
530
- else if (hour != 12) hour = hour % 12;
531
- picker.widget.find('.timepicker [data-action=togglePeriod]').text(period);
532
- }
533
- timeComponents.filter('[data-time-component=hours]').text(padLeft(hour));
534
- timeComponents.filter('[data-time-component=minutes]').text(padLeft(picker.date.minutes()));
535
- timeComponents.filter('[data-time-component=seconds]').text(padLeft(picker.date.second()));
536
- },
537
 
538
- click = function (e) {
539
- e.stopPropagation();
540
- e.preventDefault();
541
- picker.unset = false;
542
- var target = $(e.target).closest('span, td, th'), month, year, step, day, oldDate = pMoment(picker.date);
543
- if (target.length === 1) {
544
- if (!target.is('.disabled')) {
545
- switch (target[0].nodeName.toLowerCase()) {
546
- case 'th':
547
- switch (target[0].className) {
548
- case 'switch':
549
- showMode(1);
550
- break;
551
- case 'prev':
552
- case 'next':
553
- step = dpGlobal.modes[picker.viewMode].navStep;
554
- if (target[0].className === 'prev') step = step * -1;
555
- picker.viewDate.add(step, dpGlobal.modes[picker.viewMode].navFnc);
556
- fillDate();
557
- break;
558
- }
559
- break;
560
- case 'span':
561
- if (target.is('.month')) {
562
- month = target.parent().find('span').index(target);
563
- picker.viewDate.month(month);
564
- } else {
565
- year = parseInt(target.text(), 10) || 0;
566
- picker.viewDate.year(year);
567
- }
568
- if (picker.viewMode === picker.minViewMode) {
569
- picker.date = pMoment({
570
- y: picker.viewDate.year(),
571
- M: picker.viewDate.month(),
572
- d: picker.viewDate.date(),
573
- h: picker.date.hours(),
574
- m: picker.date.minutes(),
575
- s: picker.date.seconds()
576
- });
577
- notifyChange(oldDate, e.type);
578
- set();
579
- }
580
- showMode(-1);
581
- fillDate();
582
- break;
583
- case 'td':
584
- if (target.is('.day')) {
585
- day = parseInt(target.text(), 10) || 1;
586
- month = picker.viewDate.month();
587
- year = picker.viewDate.year();
588
- if (target.is('.old')) {
589
- if (month === 0) {
590
- month = 11;
591
- year -= 1;
592
- } else {
593
- month -= 1;
594
- }
595
- } else if (target.is('.new')) {
596
- if (month == 11) {
597
- month = 0;
598
- year += 1;
599
- } else {
600
- month += 1;
601
- }
602
- }
603
- picker.date = pMoment({
604
- y: year,
605
- M: month,
606
- d: day,
607
- h: picker.date.hours(),
608
- m: picker.date.minutes(),
609
- s: picker.date.seconds()
610
- }
611
- );
612
- picker.viewDate = pMoment({
613
- y: year, M: month, d: Math.min(28, day)
614
- });
615
- fillDate();
616
- set();
617
- notifyChange(oldDate, e.type);
618
- }
619
- break;
620
- }
621
- }
622
- }
623
- },
624
 
625
- actions = {
626
- incrementHours: function () {
627
- checkDate("add", "hours", 1);
628
- },
629
-
630
- incrementMinutes: function () {
631
- checkDate("add", "minutes", picker.options.minuteStepping);
632
- },
633
-
634
- incrementSeconds: function () {
635
- checkDate("add", "seconds", 1);
636
- },
637
-
638
- decrementHours: function () {
639
- checkDate("subtract", "hours", 1);
640
- },
641
-
642
- decrementMinutes: function () {
643
- checkDate("subtract", "minutes", picker.options.minuteStepping);
644
- },
645
-
646
- decrementSeconds: function () {
647
- checkDate("subtract", "seconds", 1);
648
- },
649
-
650
- togglePeriod: function () {
651
- var hour = picker.date.hours();
652
- if (hour >= 12) hour -= 12;
653
- else hour += 12;
654
- picker.date.hours(hour);
655
- },
656
-
657
- showPicker: function () {
658
- picker.widget.find('.timepicker > div:not(.timepicker-picker)').hide();
659
- picker.widget.find('.timepicker .timepicker-picker').show();
660
- },
661
-
662
- showHours: function () {
663
- picker.widget.find('.timepicker .timepicker-picker').hide();
664
- picker.widget.find('.timepicker .timepicker-hours').show();
665
- },
666
-
667
- showMinutes: function () {
668
- picker.widget.find('.timepicker .timepicker-picker').hide();
669
- picker.widget.find('.timepicker .timepicker-minutes').show();
670
- },
671
-
672
- showSeconds: function () {
673
- picker.widget.find('.timepicker .timepicker-picker').hide();
674
- picker.widget.find('.timepicker .timepicker-seconds').show();
675
- },
676
-
677
- selectHour: function (e) {
678
- var period = picker.widget.find('.timepicker [data-action=togglePeriod]').text(), hour = parseInt($(e.target).text(), 10);
679
- if (period == "PM") hour += 12
680
- picker.date.hours(hour);
681
- actions.showPicker.call(picker);
682
- },
683
-
684
- selectMinute: function (e) {
685
- picker.date.minutes(parseInt($(e.target).text(), 10));
686
- actions.showPicker.call(picker);
687
- },
688
-
689
- selectSecond: function (e) {
690
- picker.date.seconds(parseInt($(e.target).text(), 10));
691
- actions.showPicker.call(picker);
692
- }
693
- },
694
-
695
- doAction = function (e) {
696
- var oldDate = pMoment(picker.date), action = $(e.currentTarget).data('action'), rv = actions[action].apply(picker, arguments);
697
- stopEvent(e);
698
- if (!picker.date) picker.date = pMoment({ y: 1970 });
699
- set();
700
- fillTime();
701
- notifyChange(oldDate, e.type);
702
- return rv;
703
- },
704
-
705
- stopEvent = function (e) {
706
- e.stopPropagation();
707
- e.preventDefault();
708
- },
709
 
710
- change = function (e) {
711
- pMoment.lang(picker.options.language);
712
- var input = $(e.target), oldDate = pMoment(picker.date), newDate = pMoment(input.val(), picker.format, picker.options.useStrict);
713
- if (newDate.isValid() && !isInDisableDates(newDate) && isInEnableDates(newDate)) {
714
  update();
715
- picker.setValue(newDate);
716
- notifyChange(oldDate, e.type);
717
- set();
718
  }
719
- else {
720
- picker.viewDate = oldDate;
721
- notifyChange(oldDate, e.type);
722
- notifyError(newDate);
723
- picker.unset = true;
724
  }
725
- },
 
 
 
726
 
727
- showMode = function (dir) {
728
- if (dir) {
729
- picker.viewMode = Math.max(picker.minViewMode, Math.min(2, picker.viewMode + dir));
 
 
 
 
 
 
 
 
 
730
  }
731
- var f = dpGlobal.modes[picker.viewMode].clsName;
732
- picker.widget.find('.datepicker > div').hide().filter('.datepicker-' + dpGlobal.modes[picker.viewMode].clsName).show();
733
- },
734
-
735
- attachDatePickerEvents = function () {
736
- var $this, $parent, expanded, closed, collapseData;
737
- picker.widget.on('click', '.datepicker *', $.proxy(click, this)); // this handles date picker clicks
738
- picker.widget.on('click', '[data-action]', $.proxy(doAction, this)); // this handles time picker clicks
739
- picker.widget.on('mousedown', $.proxy(stopEvent, this));
740
- if (picker.options.pickDate && picker.options.pickTime) {
741
- picker.widget.on('click.togglePicker', '.accordion-toggle', function (e) {
742
- e.stopPropagation();
743
- $this = $(this);
744
- $parent = $this.closest('ul');
745
- expanded = $parent.find('.in');
746
- closed = $parent.find('.collapse:not(.in)');
747
 
748
- if (expanded && expanded.length) {
749
- collapseData = expanded.data('collapse');
750
- if (collapseData && collapseData.date - transitioning) return;
751
- expanded.collapse('hide');
752
- closed.collapse('show');
753
- $this.find('span').toggleClass(picker.options.icons.time + ' ' + picker.options.icons.date);
754
- picker.element.find('.input-group-addon span').toggleClass(picker.options.icons.time + ' ' + picker.options.icons.date);
755
- }
756
- });
757
  }
758
- if (picker.isInput) {
759
- picker.element.on({
760
- 'focus': $.proxy(picker.show, this),
761
- 'change': $.proxy(change, this),
762
- 'blur': $.proxy(picker.hide, this)
763
- });
764
- } else {
765
- picker.element.on({
766
- 'change': $.proxy(change, this)
767
- }, 'input');
768
- if (picker.component) {
769
- picker.component.on('click', $.proxy(picker.show, this));
770
- } else {
771
- picker.element.on('click', $.proxy(picker.show, this));
772
  }
 
773
  }
774
- },
 
 
775
 
776
- attachDatePickerGlobalEvents = function () {
777
- $(window).on(
778
- 'resize.datetimepicker' + picker.id, $.proxy(place, this));
779
- if (!picker.isInput) {
780
- $(document).on(
781
- 'mousedown.datetimepicker' + picker.id, $.proxy(picker.hide, this));
 
 
 
 
 
782
  }
783
- },
784
 
785
- detachDatePickerEvents = function () {
786
- picker.widget.off('click', '.datepicker *', picker.click);
787
- picker.widget.off('click', '[data-action]');
788
- picker.widget.off('mousedown', picker.stopEvent);
789
- if (picker.options.pickDate && picker.options.pickTime) {
790
- picker.widget.off('click.togglePicker');
791
- }
792
- if (picker.isInput) {
793
- picker.element.off({
794
- 'focus': picker.show,
795
- 'change': picker.change
796
- });
797
- } else {
798
- picker.element.off({
799
- 'change': picker.change
800
- }, 'input');
801
- if (picker.component) {
802
- picker.component.off('click', picker.show);
803
- } else {
804
- picker.element.off('click', picker.show);
805
- }
806
  }
807
- },
808
-
809
- detachDatePickerGlobalEvents = function () {
810
- $(window).off('resize.datetimepicker' + picker.id);
811
- if (!picker.isInput) {
812
- $(document).off('mousedown.datetimepicker' + picker.id);
813
  }
814
- },
815
-
816
- isInFixed = function () {
817
- if (picker.element) {
818
- var parents = picker.element.parents(), inFixed = false, i;
819
- for (i = 0; i < parents.length; i++) {
820
- if ($(parents[i]).css('position') == 'fixed') {
821
- inFixed = true;
822
- break;
823
  }
 
824
  }
825
- ;
826
- return inFixed;
827
- } else {
828
- return false;
829
- }
830
- },
831
-
832
- set = function () {
833
- pMoment.lang(picker.options.language);
834
- var formatted = '', input;
835
- if (!picker.unset) formatted = pMoment(picker.date).format(picker.format);
836
- getPickerInput().val(formatted);
837
- picker.element.data('date', formatted);
838
- if (!picker.options.pickTime) picker.hide();
839
- },
840
-
841
- checkDate = function (direction, unit, amount) {
842
- pMoment.lang(picker.options.language);
843
- var newDate;
844
- if (direction == "add") {
845
- newDate = pMoment(picker.date);
846
- if (newDate.hours() == 23) newDate.add(amount, unit);
847
- newDate.add(amount, unit);
848
- }
849
- else {
850
- newDate = pMoment(picker.date).subtract(amount, unit);
851
- }
852
- if (isInDisableDates(pMoment(newDate.subtract(amount, unit))) || isInDisableDates(newDate)) {
853
- notifyError(newDate.format(picker.format));
854
- return;
855
- }
856
-
857
- if (direction == "add") {
858
- picker.date.add(amount, unit);
859
- }
860
- else {
861
- picker.date.subtract(amount, unit);
862
- }
863
- picker.unset = false;
864
- },
865
-
866
- isInDisableDates = function (date) {
867
- pMoment.lang(picker.options.language);
868
- if (date.isAfter(picker.options.maxDate) || date.isBefore(picker.options.minDate)) return true;
869
- if (picker.options.disabledDates === false) {
870
- return false;
871
  }
872
- return picker.options.disabledDates[pMoment(date).format("YYYY-MM-DD")] === true;
873
- },
874
- isInEnableDates = function (date) {
875
- pMoment.lang(picker.options.language);
876
- if (picker.options.enabledDates === false) {
877
- return true;
 
 
 
 
 
878
  }
879
- return picker.options.enabledDates[pMoment(date).format("YYYY-MM-DD")] === true;
880
- },
881
 
882
- indexGivenDates = function (givenDatesArray) {
883
- // Store given enabledDates and disabledDates as keys.
884
- // This way we can check their existence in O(1) time instead of looping through whole array.
885
- // (for example: picker.options.enabledDates['2014-02-27'] === true)
886
- var givenDatesIndexed = {};
887
- var givenDatesCount = 0;
888
- for (i = 0; i < givenDatesArray.length; i++) {
889
- dDate = pMoment(givenDatesArray[i]);
890
- if (dDate.isValid()) {
891
- givenDatesIndexed[dDate.format("YYYY-MM-DD")] = true;
892
- givenDatesCount++;
893
- }
894
  }
895
- if (givenDatesCount > 0) {
896
- return givenDatesIndexed;
 
897
  }
898
- return false;
899
- },
900
 
901
- padLeft = function (string) {
902
- string = string.toString();
903
- if (string.length >= 2) return string;
904
- else return '0' + string;
905
- },
906
 
907
- getTemplate = function () {
908
- if (picker.options.pickDate && picker.options.pickTime) {
909
- var ret = '';
910
- ret = '<div class="bootstrap-datetimepicker-widget' + (picker.options.sideBySide ? ' timepicker-sbs' : '') + ' dropdown-menu" style="z-index:9999 !important;">';
911
- if (picker.options.sideBySide) {
912
- ret += '<div class="row">' +
913
- '<div class="col-sm-6 datepicker">' + dpGlobal.template + '</div>' +
914
- '<div class="col-sm-6 timepicker">' + tpGlobal.getTemplate() + '</div>' +
915
- '</div>';
916
- } else {
917
- ret += '<ul class="list-unstyled">' +
918
- '<li' + (picker.options.collapse ? ' class="collapse in"' : '') + '>' +
919
- '<div class="datepicker">' + dpGlobal.template + '</div>' +
920
- '</li>' +
921
- '<li class="picker-switch accordion-toggle"><a class="btn" style="width:100%"><span class="' + picker.options.icons.time + '"></span></a></li>' +
922
- '<li' + (picker.options.collapse ? ' class="collapse"' : '') + '>' +
923
- '<div class="timepicker">' + tpGlobal.getTemplate() + '</div>' +
924
- '</li>' +
925
- '</ul>';
926
- }
927
- ret += '</div>';
928
- return ret;
929
- } else if (picker.options.pickTime) {
930
- return (
931
- '<div class="bootstrap-datetimepicker-widget dropdown-menu">' +
932
- '<div class="timepicker">' + tpGlobal.getTemplate() + '</div>' +
933
- '</div>'
934
- );
935
  } else {
936
- return (
937
- '<div class="bootstrap-datetimepicker-widget dropdown-menu">' +
938
- '<div class="datepicker">' + dpGlobal.template + '</div>' +
939
- '</div>'
940
- );
941
  }
942
- },
943
 
944
- dpGlobal = {
945
- modes: [
946
- {
947
- clsName: 'days',
948
- navFnc: 'month',
949
- navStep: 1
950
- },
951
- {
952
- clsName: 'months',
953
- navFnc: 'year',
954
- navStep: 1
955
- },
956
- {
957
- clsName: 'years',
958
- navFnc: 'year',
959
- navStep: 10
960
- }],
961
- headTemplate:
962
- '<thead>' +
963
- '<tr>' +
964
- '<th class="prev">&lsaquo;</th><th colspan="5" class="switch"></th><th class="next">&rsaquo;</th>' +
965
- '</tr>' +
966
- '</thead>',
967
- contTemplate:
968
- '<tbody><tr><td colspan="7"></td></tr></tbody>'
969
- },
970
-
971
- tpGlobal = {
972
- hourTemplate: '<span data-action="showHours" data-time-component="hours" class="timepicker-hour"></span>',
973
- minuteTemplate: '<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"></span>',
974
- secondTemplate: '<span data-action="showSeconds" data-time-component="seconds" class="timepicker-second"></span>'
975
- };
976
 
977
- dpGlobal.template =
978
- '<div class="datepicker-days">' +
979
- '<table class="table-condensed">' + dpGlobal.headTemplate + '<tbody></tbody></table>' +
980
- '</div>' +
981
- '<div class="datepicker-months">' +
982
- '<table class="table-condensed">' + dpGlobal.headTemplate + dpGlobal.contTemplate + '</table>' +
983
- '</div>' +
984
- '<div class="datepicker-years">' +
985
- '<table class="table-condensed">' + dpGlobal.headTemplate + dpGlobal.contTemplate + '</table>' +
986
- '</div>';
987
-
988
- tpGlobal.getTemplate = function () {
989
- return (
990
- '<div class="timepicker-picker">' +
991
- '<table class="table-condensed">' +
992
- '<tr>' +
993
- '<td><a href="#" class="btn" data-action="incrementHours"><span class="' + picker.options.icons.up + '"></span></a></td>' +
994
- '<td class="separator"></td>' +
995
- '<td>' + (picker.options.useMinutes ? '<a href="#" class="btn" data-action="incrementMinutes"><span class="' + picker.options.icons.up + '"></span></a>' : '') + '</td>' +
996
- (picker.options.useSeconds ?
997
- '<td class="separator"></td><td><a href="#" class="btn" data-action="incrementSeconds"><span class="' + picker.options.icons.up + '"></span></a></td>' : '') +
998
- (picker.use24hours ? '' : '<td class="separator"></td>') +
999
- '</tr>' +
1000
- '<tr>' +
1001
- '<td>' + tpGlobal.hourTemplate + '</td> ' +
1002
- '<td class="separator">:</td>' +
1003
- '<td>' + (picker.options.useMinutes ? tpGlobal.minuteTemplate : '<span class="timepicker-minute">00</span>') + '</td> ' +
1004
- (picker.options.useSeconds ?
1005
- '<td class="separator">:</td><td>' + tpGlobal.secondTemplate + '</td>' : '') +
1006
- (picker.use24hours ? '' : '<td class="separator"></td>' +
1007
- '<td><button type="button" class="btn btn-primary" data-action="togglePeriod"></button></td>') +
1008
- '</tr>' +
1009
- '<tr>' +
1010
- '<td><a href="#" class="btn" data-action="decrementHours"><span class="' + picker.options.icons.down + '"></span></a></td>' +
1011
- '<td class="separator"></td>' +
1012
- '<td>' + (picker.options.useMinutes ? '<a href="#" class="btn" data-action="decrementMinutes"><span class="' + picker.options.icons.down + '"></span></a>' : '') + '</td>' +
1013
- (picker.options.useSeconds ?
1014
- '<td class="separator"></td><td><a href="#" class="btn" data-action="decrementSeconds"><span class="' + picker.options.icons.down + '"></span></a></td>' : '') +
1015
- (picker.use24hours ? '' : '<td class="separator"></td>') +
1016
- '</tr>' +
1017
- '</table>' +
1018
- '</div>' +
1019
- '<div class="timepicker-hours" data-action="selectHour">' +
1020
- '<table class="table-condensed"></table>' +
1021
- '</div>' +
1022
- '<div class="timepicker-minutes" data-action="selectMinute">' +
1023
- '<table class="table-condensed"></table>' +
1024
- '</div>' +
1025
- (picker.options.useSeconds ?
1026
- '<div class="timepicker-seconds" data-action="selectSecond"><table class="table-condensed"></table></div>' : '')
1027
- );
1028
- };
1029
 
1030
- picker.destroy = function () {
1031
- detachDatePickerEvents();
1032
- detachDatePickerGlobalEvents();
1033
- picker.widget.remove();
1034
- picker.element.removeData('DateTimePicker');
1035
- if (picker.component)
1036
- picker.component.removeData('DateTimePicker');
1037
- };
1038
 
1039
- picker.show = function (e) {
1040
- if (picker.options.useCurrent === true) {
1041
- if (getPickerInput().val() == '') {
1042
- picker.setValue(pMoment().format(picker.format))
1043
- };
1044
- }
1045
- picker.widget.show();
1046
- picker.height = picker.component ? picker.component.outerHeight() : picker.element.outerHeight();
1047
- place();
1048
- picker.element.trigger({
1049
- type: 'dp.show',
1050
- date: pMoment(picker.date)
1051
- });
1052
- attachDatePickerGlobalEvents();
1053
- if (e) {
1054
- stopEvent(e);
1055
- }
1056
- },
1057
 
1058
- picker.disable = function () {
1059
- var input = picker.element.find('input');
1060
- if (input.prop('disabled')) return;
1061
 
1062
- input.prop('disabled', true);
1063
- detachDatePickerEvents();
1064
- },
1065
 
1066
- picker.enable = function () {
1067
- var input = picker.element.find('input');
1068
- if (!input.prop('disabled')) return;
 
 
 
 
 
 
 
 
 
 
 
1069
 
1070
- input.prop('disabled', false);
1071
- attachDatePickerEvents();
1072
- },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1073
 
1074
- picker.hide = function (event) {
1075
- if (event && $(event.target).is(picker.element.attr("id")))
1076
- return;
1077
- // Ignore event if in the middle of a picker transition
1078
- var collapse = picker.widget.find('.collapse'), i, collapseData;
1079
- for (i = 0; i < collapse.length; i++) {
1080
- collapseData = collapse.eq(i).data('collapse');
1081
- if (collapseData && collapseData.date - transitioning)
1082
- return;
1083
- }
1084
- picker.widget.hide();
1085
- picker.viewMode = picker.startViewMode;
1086
- showMode();
1087
- picker.element.trigger({
1088
- type: 'dp.hide',
1089
- date: pMoment(picker.date)
1090
  });
1091
- detachDatePickerGlobalEvents();
1092
- },
1093
 
1094
- picker.setValue = function (newDate) {
1095
- pMoment.lang(picker.options.language);
1096
- if (!newDate) {
1097
- picker.unset = true;
1098
- set();
1099
- } else {
1100
- picker.unset = false;
1101
- }
1102
- if (!pMoment.isMoment(newDate)) newDate = pMoment(newDate);
1103
- if (newDate.isValid()) {
1104
- picker.date = newDate;
1105
- set();
1106
- picker.viewDate = pMoment({ y: picker.date.year(), M: picker.date.month() });
1107
- fillDate();
1108
- fillTime();
1109
- }
1110
- else {
1111
- notifyError(newDate);
1112
  }
1113
- },
1114
 
1115
- picker.getDate = function () {
1116
- if (picker.unset) return null;
1117
- return picker.date;
1118
- },
1119
 
1120
- picker.setDate = function (date) {
1121
- var oldDate = pMoment(picker.date);
1122
- if (!date) {
1123
- picker.setValue(null);
1124
- } else {
1125
- picker.setValue(date);
1126
- }
1127
- notifyChange(oldDate, "function");
1128
- },
1129
 
1130
- picker.setDisabledDates = function (dates) {
1131
- picker.options.disabledDates = indexGivenDates(dates);
1132
- if (picker.viewDate) update();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1133
  },
1134
- picker.setEnabledDates = function (dates) {
1135
- picker.options.enabledDates = indexGivenDates(dates);
1136
- if (picker.viewDate) update();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1137
  },
1138
-
1139
- picker.setMaxDate = function (date) {
1140
- if (date == undefined) return;
1141
- picker.options.maxDate = pMoment(date);
1142
- if (picker.viewDate) update();
 
 
 
 
 
 
 
1143
  },
1144
-
1145
- picker.setMinDate = function (date) {
1146
- if (date == undefined) return;
1147
- picker.options.minDate = pMoment(date);
1148
- if (picker.viewDate) update();
1149
- };
1150
-
1151
- init();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1152
  };
1153
 
1154
- $.fn.datetimepicker = function (options) {
1155
- return this.each(function () {
1156
- var $this = $(this), data = $this.data('DateTimePicker');
1157
- if (!data) $this.data('DateTimePicker', new DateTimePicker(this, options));
1158
- });
1159
- };
1160
  }));
1
+ /*! version : 4.17.47
2
+ =========================================================
3
+ bootstrap-datetimejs
4
+ https://github.com/Eonasdan/bootstrap-datetimepicker
5
+ Copyright (c) 2015 Jonathan Peterson
6
+ =========================================================
7
+ */
8
  /*
9
+ The MIT License (MIT)
10
+
11
+ Copyright (c) 2015 Jonathan Peterson
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in
21
+ all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29
+ THE SOFTWARE.
30
+ */
31
+ /*global define:false */
32
+ /*global exports:false */
33
+ /*global require:false */
34
+ /*global jQuery:false */
35
+ /*global moment:false */
36
+ (function (factory) {
37
+ 'use strict';
38
  if (typeof define === 'function' && define.amd) {
39
  // AMD is used - Register as an anonymous module.
40
  define(['jquery', 'moment'], factory);
41
+ } else if (typeof exports === 'object') {
42
+ module.exports = factory(require('jquery'), require('moment'));
43
  } else {
44
+ // Neither AMD nor CommonJS used. Use global variables.
45
+ if (typeof jQuery === 'undefined') {
46
  throw 'bootstrap-datetimepicker requires jQuery to be loaded first';
 
 
 
 
47
  }
48
+ if (typeof moment === 'undefined') {
49
+ throw 'bootstrap-datetimepicker requires Moment.js to be loaded first';
50
+ }
51
+ factory(jQuery, moment);
52
+ }
53
+ }(function ($, moment) {
54
+ 'use strict';
55
+ if (!moment) {
56
+ throw new Error('bootstrap-datetimepicker requires Moment.js to be loaded first');
57
  }
 
58
 
59
+ var dateTimePicker = function (element, options) {
60
+ var picker = {},
61
+ date,
62
+ viewDate,
63
+ unset = true,
64
+ input,
65
+ component = false,
66
+ widget = false,
67
+ use24Hours,
68
+ minViewModeNumber = 0,
69
+ actualFormat,
70
+ parseFormats,
71
+ currentViewMode,
72
+ datePickerModes = [
73
+ {
74
+ clsName: 'days',
75
+ navFnc: 'M',
76
+ navStep: 1
77
+ },
78
+ {
79
+ clsName: 'months',
80
+ navFnc: 'y',
81
+ navStep: 1
82
+ },
83
+ {
84
+ clsName: 'years',
85
+ navFnc: 'y',
86
+ navStep: 10
87
+ },
88
+ {
89
+ clsName: 'decades',
90
+ navFnc: 'y',
91
+ navStep: 100
92
+ }
93
+ ],
94
+ viewModes = ['days', 'months', 'years', 'decades'],
95
+ verticalModes = ['top', 'bottom', 'auto'],
96
+ horizontalModes = ['left', 'right', 'auto'],
97
+ toolbarPlacements = ['default', 'top', 'bottom'],
98
+ keyMap = {
99
+ 'up': 38,
100
+ 38: 'up',
101
+ 'down': 40,
102
+ 40: 'down',
103
+ 'left': 37,
104
+ 37: 'left',
105
+ 'right': 39,
106
+ 39: 'right',
107
+ 'tab': 9,
108
+ 9: 'tab',
109
+ 'escape': 27,
110
+ 27: 'escape',
111
+ 'enter': 13,
112
+ 13: 'enter',
113
+ 'pageUp': 33,
114
+ 33: 'pageUp',
115
+ 'pageDown': 34,
116
+ 34: 'pageDown',
117
+ 'shift': 16,
118
+ 16: 'shift',
119
+ 'control': 17,
120
+ 17: 'control',
121
+ 'space': 32,
122
+ 32: 'space',
123
+ 't': 84,
124
+ 84: 't',
125
+ 'delete': 46,
126
+ 46: 'delete'
127
+ },
128
+ keyState = {},
129
+
130
+ /********************************************************************************
131
+ *
132
+ * Private functions
133
+ *
134
+ ********************************************************************************/
135
+
136
+ hasTimeZone = function () {
137
+ return moment.tz !== undefined && options.timeZone !== undefined && options.timeZone !== null && options.timeZone !== '';
138
+ },
139
+
140
+ getMoment = function (d) {
141
+ var returnMoment;
142
+
143
+ if (d === undefined || d === null) {
144
+ returnMoment = moment(); //TODO should this use format? and locale?
145
+ } else if (moment.isDate(d) || moment.isMoment(d)) {
146
+ // If the date that is passed in is already a Date() or moment() object,
147
+ // pass it directly to moment.
148
+ returnMoment = moment(d);
149
+ } else if (hasTimeZone()) { // There is a string to parse and a default time zone
150
+ // parse with the tz function which takes a default time zone if it is not in the format string
151
+ returnMoment = moment.tz(d, parseFormats, options.useStrict, options.timeZone);
152
+ } else {
153
+ returnMoment = moment(d, parseFormats, options.useStrict);
154
+ }
155
 
156
+ if (hasTimeZone()) {
157
+ returnMoment.tz(options.timeZone);
158
+ }
159
+
160
+ return returnMoment;
161
+ },
162
+
163
+ isEnabled = function (granularity) {
164
+ if (typeof granularity !== 'string' || granularity.length > 1) {
165
+ throw new TypeError('isEnabled expects a single character string parameter');
166
+ }
167
+ switch (granularity) {
168
+ case 'y':
169
+ return actualFormat.indexOf('Y') !== -1;
170
+ case 'M':
171
+ return actualFormat.indexOf('M') !== -1;
172
+ case 'd':
173
+ return actualFormat.toLowerCase().indexOf('d') !== -1;
174
+ case 'h':
175
+ case 'H':
176
+ return actualFormat.toLowerCase().indexOf('h') !== -1;
177
+ case 'm':
178
+ return actualFormat.indexOf('m') !== -1;
179
+ case 's':
180
+ return actualFormat.indexOf('s') !== -1;
181
+ default:
182
+ return false;
183
+ }
184
+ },
185
+
186
+ hasTime = function () {
187
+ return (isEnabled('h') || isEnabled('m') || isEnabled('s'));
188
+ },
189
+
190
+ hasDate = function () {
191
+ return (isEnabled('y') || isEnabled('M') || isEnabled('d'));
192
+ },
193
+
194
+ getDatePickerTemplate = function () {
195
+ var headTemplate = $('<thead>')
196
+ .append($('<tr>')
197
+ .append($('<th>').addClass('prev').attr('data-action', 'previous')
198
+ .append($('<span>').addClass(options.icons.previous))
199
+ )
200
+ .append($('<th>').addClass('picker-switch').attr('data-action', 'pickerSwitch').attr('colspan', (options.calendarWeeks ? '6' : '5')))
201
+ .append($('<th>').addClass('next').attr('data-action', 'next')
202
+ .append($('<span>').addClass(options.icons.next))
203
+ )
204
+ ),
205
+ contTemplate = $('<tbody>')
206
+ .append($('<tr>')
207
+ .append($('<td>').attr('colspan', (options.calendarWeeks ? '8' : '7')))
208
+ );
209
+
210
+ return [
211
+ $('<div>').addClass('datepicker-days')
212
+ .append($('<table>').addClass('table-condensed')
213
+ .append(headTemplate)
214
+ .append($('<tbody>'))
215
+ ),
216
+ $('<div>').addClass('datepicker-months')
217
+ .append($('<table>').addClass('table-condensed')
218
+ .append(headTemplate.clone())
219
+ .append(contTemplate.clone())
220
+ ),
221
+ $('<div>').addClass('datepicker-years')
222
+ .append($('<table>').addClass('table-condensed')
223
+ .append(headTemplate.clone())
224
+ .append(contTemplate.clone())
225
+ ),
226
+ $('<div>').addClass('datepicker-decades')
227
+ .append($('<table>').addClass('table-condensed')
228
+ .append(headTemplate.clone())
229
+ .append(contTemplate.clone())
230
+ )
231
+ ];
232
+ },
233
+
234
+ getTimePickerMainTemplate = function () {
235
+ var topRow = $('<tr>'),
236
+ middleRow = $('<tr>'),
237
+ bottomRow = $('<tr>');
238
+
239
+ if (isEnabled('h')) {
240
+ topRow.append($('<td>')
241
+ .append($('<a>').attr({ href: '#', tabindex: '-1', 'title': options.tooltips.incrementHour }).addClass('btn').attr('data-action', 'incrementHours').append($('<span>').addClass(options.icons.up))));
242
+ middleRow.append($('<td>')
243
+ .append($('<span>').addClass('timepicker-hour').attr({ 'data-time-component': 'hours', 'title': options.tooltips.pickHour }).attr('data-action', 'showHours')));
244
+ bottomRow.append($('<td>')
245
+ .append($('<a>').attr({ href: '#', tabindex: '-1', 'title': options.tooltips.decrementHour }).addClass('btn').attr('data-action', 'decrementHours').append($('<span>').addClass(options.icons.down))));
246
+ }
247
+ if (isEnabled('m')) {
248
+ if (isEnabled('h')) {
249
+ topRow.append($('<td>').addClass('separator'));
250
+ middleRow.append($('<td>').addClass('separator').html(':'));
251
+ bottomRow.append($('<td>').addClass('separator'));
252
+ }
253
+ topRow.append($('<td>')
254
+ .append($('<a>').attr({ href: '#', tabindex: '-1', 'title': options.tooltips.incrementMinute }).addClass('btn').attr('data-action', 'incrementMinutes')
255
+ .append($('<span>').addClass(options.icons.up))));
256
+ middleRow.append($('<td>')
257
+ .append($('<span>').addClass('timepicker-minute').attr({ 'data-time-component': 'minutes', 'title': options.tooltips.pickMinute }).attr('data-action', 'showMinutes')));
258
+ bottomRow.append($('<td>')
259
+ .append($('<a>').attr({ href: '#', tabindex: '-1', 'title': options.tooltips.decrementMinute }).addClass('btn').attr('data-action', 'decrementMinutes')
260
+ .append($('<span>').addClass(options.icons.down))));
261
+ }
262
+ if (isEnabled('s')) {
263
+ if (isEnabled('m')) {
264
+ topRow.append($('<td>').addClass('separator'));
265
+ middleRow.append($('<td>').addClass('separator').html(':'));
266
+ bottomRow.append($('<td>').addClass('separator'));
267
+ }
268
+ topRow.append($('<td>')
269
+ .append($('<a>').attr({ href: '#', tabindex: '-1', 'title': options.tooltips.incrementSecond }).addClass('btn').attr('data-action', 'incrementSeconds')
270
+ .append($('<span>').addClass(options.icons.up))));
271
+ middleRow.append($('<td>')
272
+ .append($('<span>').addClass('timepicker-second').attr({ 'data-time-component': 'seconds', 'title': options.tooltips.pickSecond }).attr('data-action', 'showSeconds')));
273
+ bottomRow.append($('<td>')
274
+ .append($('<a>').attr({ href: '#', tabindex: '-1', 'title': options.tooltips.decrementSecond }).addClass('btn').attr('data-action', 'decrementSeconds')
275
+ .append($('<span>').addClass(options.icons.down))));
276
+ }
277
+
278
+ if (!use24Hours) {
279
+ topRow.append($('<td>').addClass('separator'));
280
+ middleRow.append($('<td>')
281
+ .append($('<button>').addClass('btn btn-primary').attr({ 'data-action': 'togglePeriod', tabindex: '-1', 'title': options.tooltips.togglePeriod })));
282
+ bottomRow.append($('<td>').addClass('separator'));
283
+ }
284
+
285
+ return $('<div>').addClass('timepicker-picker')
286
+ .append($('<table>').addClass('table-condensed')
287
+ .append([topRow, middleRow, bottomRow]));
288
+ },
289
+
290
+ getTimePickerTemplate = function () {
291
+ var hoursView = $('<div>').addClass('timepicker-hours')
292
+ .append($('<table>').addClass('table-condensed')),
293
+ minutesView = $('<div>').addClass('timepicker-minutes')
294
+ .append($('<table>').addClass('table-condensed')),
295
+ secondsView = $('<div>').addClass('timepicker-seconds')
296
+ .append($('<table>').addClass('table-condensed')),
297
+ ret = [getTimePickerMainTemplate()];
298
+
299
+ if (isEnabled('h')) {
300
+ ret.push(hoursView);
301
+ }
302
+ if (isEnabled('m')) {
303
+ ret.push(minutesView);
304
+ }
305
+ if (isEnabled('s')) {
306
+ ret.push(secondsView);
307
+ }
308
+
309
+ return ret;
310
+ },
311
+
312
+ getToolbar = function () {
313
+ var row = [];
314
+ if (options.showTodayButton) {
315
+ row.push($('<td>').append($('<a>').attr({ 'data-action': 'today', 'title': options.tooltips.today }).append($('<span>').addClass(options.icons.today))));
316
+ }
317
+ if (!options.sideBySide && hasDate() && hasTime()) {
318
+ row.push($('<td>').append($('<a>').attr({ 'data-action': 'togglePicker', 'title': options.tooltips.selectTime }).append($('<span>').addClass(options.icons.time))));
319
+ }
320
+ if (options.showClear) {
321
+ row.push($('<td>').append($('<a>').attr({ 'data-action': 'clear', 'title': options.tooltips.clear }).append($('<span>').addClass(options.icons.clear))));
322
+ }
323
+ if (options.showClose) {
324
+ row.push($('<td>').append($('<a>').attr({ 'data-action': 'close', 'title': options.tooltips.close }).append($('<span>').addClass(options.icons.close))));
325
+ }
326
+ return $('<table>').addClass('table-condensed').append($('<tbody>').append($('<tr>').append(row)));
327
+ },
328
+
329
+ getTemplate = function () {
330
+ var template = $('<div>').addClass('bootstrap-datetimepicker-widget dropdown-menu'),
331
+ dateView = $('<div>').addClass('datepicker').append(getDatePickerTemplate()),
332
+ timeView = $('<div>').addClass('timepicker').append(getTimePickerTemplate()),
333
+ content = $('<ul>').addClass('list-unstyled'),
334
+ toolbar = $('<li>').addClass('picker-switch' + (options.collapse ? ' accordion-toggle' : '')).append(getToolbar());
335
+
336
+ if (options.inline) {
337
+ template.removeClass('dropdown-menu');
338
+ }
339
+
340
+ if (use24Hours) {
341
+ template.addClass('usetwentyfour');
342
+ }
343
+
344
+ if (isEnabled('s') && !use24Hours) {
345
+ template.addClass('wider');
346
+ }
347
+
348
+ if (options.sideBySide && hasDate() && hasTime()) {
349
+ template.addClass('timepicker-sbs');
350
+ if (options.toolbarPlacement === 'top') {
351
+ template.append(toolbar);
352
+ }
353
+ template.append(
354
+ $('<div>').addClass('row')
355
+ .append(dateView.addClass('col-md-6'))
356
+ .append(timeView.addClass('col-md-6'))
357
+ );
358
+ if (options.toolbarPlacement === 'bottom') {
359
+ template.append(toolbar);
360
+ }
361
+ return template;
362
+ }
363
+
364
+ if (options.toolbarPlacement === 'top') {
365
+ content.append(toolbar);
366
+ }
367
+ if (hasDate()) {
368
+ content.append($('<li>').addClass((options.collapse && hasTime() ? 'collapse in' : '')).append(dateView));
369
+ }
370
+ if (options.toolbarPlacement === 'default') {
371
+ content.append(toolbar);
372
+ }
373
+ if (hasTime()) {
374
+ content.append($('<li>').addClass((options.collapse && hasDate() ? 'collapse' : '')).append(timeView));
375
+ }
376
+ if (options.toolbarPlacement === 'bottom') {
377
+ content.append(toolbar);
378
+ }
379
+ return template.append(content);
380
+ },
381
+
382
+ dataToOptions = function () {
383
+ var eData,
384
+ dataOptions = {};
385
+
386
+ if (element.is('input') || options.inline) {
387
+ eData = element.data();
388
+ } else {
389
+ eData = element.find('input').data();
390
+ }
391
+
392
+ if (eData.dateOptions && eData.dateOptions instanceof Object) {
393
+ dataOptions = $.extend(true, dataOptions, eData.dateOptions);
394
+ }
395
+
396
+ $.each(options, function (key) {
397
+ var attributeName = 'date' + key.charAt(0).toUpperCase() + key.slice(1);
398
+ if (eData[attributeName] !== undefined) {
399
+ dataOptions[key] = eData[attributeName];
400
+ }
401
+ });
402
+ return dataOptions;
403
+ },
404
+
405
+ place = function () {
406
+ var position = (component || element).position(),
407
+ offset = (component || element).offset(),
408
+ vertical = options.widgetPositioning.vertical,
409
+ horizontal = options.widgetPositioning.horizontal,
410
+ parent;
411
+
412
+ if (options.widgetParent) {
413
+ parent = options.widgetParent.append(widget);
414
+ } else if (element.is('input')) {
415
+ parent = element.after(widget).parent();
416
+ } else if (options.inline) {
417
+ parent = element.append(widget);
418
+ return;
419
+ } else {
420
+ parent = element;
421
+ element.children().first().after(widget);
422
+ }
423
+
424
+ // Top and bottom logic
425
+ if (vertical === 'auto') {
426
+ if (offset.top + widget.height() * 1.5 >= $(window).height() + $(window).scrollTop() &&
427
+ widget.height() + element.outerHeight() < offset.top) {
428
+ vertical = 'top';
429
+ } else {
430
+ vertical = 'bottom';
431
+ }
432
+ }
433
+
434
+ // Left and right logic
435
+ if (horizontal === 'auto') {
436
+ if (parent.width() < offset.left + widget.outerWidth() / 2 &&
437
+ offset.left + widget.outerWidth() > $(window).width()) {
438
+ horizontal = 'right';
439
+ } else {
440
+ horizontal = 'left';
441
+ }
442
+ }
443
+
444
+ if (vertical === 'top') {
445
+ widget.addClass('top').removeClass('bottom');
446
+ } else {
447
+ widget.addClass('bottom').removeClass('top');
448
+ }
449
+
450
+ if (horizontal === 'right') {
451
+ widget.addClass('pull-right');
452
+ } else {
453
+ widget.removeClass('pull-right');
454
+ }
455
+
456
+ // find the first parent element that has a non-static css positioning
457
+ if (parent.css('position') === 'static') {
458
+ parent = parent.parents().filter(function () {
459
+ return $(this).css('position') !== 'static';
460
+ }).first();
461
+ }
462
+
463
+ if (parent.length === 0) {
464
+ throw new Error('datetimepicker component should be placed within a non-static positioned container');
465
+ }
466
+
467
+ widget.css({
468
+ top: vertical === 'top' ? 'auto' : position.top + element.outerHeight(),
469
+ bottom: vertical === 'top' ? parent.outerHeight() - (parent === element ? 0 : position.top) : 'auto',
470
+ left: horizontal === 'left' ? (parent === element ? 0 : position.left) : 'auto',
471
+ right: horizontal === 'left' ? 'auto' : parent.outerWidth() - element.outerWidth() - (parent === element ? 0 : position.left)
472
+ });
473
+ },
474
+
475
+ notifyEvent = function (e) {
476
+ if (e.type === 'dp.change' && ((e.date && e.date.isSame(e.oldDate)) || (!e.date && !e.oldDate))) {
477
+ return;
478
+ }
479
+ element.trigger(e);
480
+ },
481
+
482
+ viewUpdate = function (e) {
483
+ if (e === 'y') {
484
+ e = 'YYYY';
485
+ }
486
+ notifyEvent({
487
+ type: 'dp.update',
488
+ change: e,
489
+ viewDate: viewDate.clone()
490
+ });
491
+ },
492
+
493
+ showMode = function (dir) {
494
+ if (!widget) {
495
+ return;
496
+ }
497
+ if (dir) {
498
+ currentViewMode = Math.max(minViewModeNumber, Math.min(3, currentViewMode + dir));
499
+ }
500
+ widget.find('.datepicker > div').hide().filter('.datepicker-' + datePickerModes[currentViewMode].clsName).show();
501
+ },
502
+
503
+ fillDow = function () {
504
+ var row = $('<tr>'),
505
+ currentDate = viewDate.clone().startOf('w').startOf('d');
506
+
507
+ if (options.calendarWeeks === true) {
508
+ row.append($('<th>').addClass('cw').text('#'));
509
+ }
510
+
511
+ while (currentDate.isBefore(viewDate.clone().endOf('w'))) {
512
+ row.append($('<th>').addClass('dow').text(currentDate.format('dd')));
513
+ currentDate.add(1, 'd');
514
+ }
515
+ widget.find('.datepicker-days thead').append(row);
516
+ },
517
+
518
+ isInDisabledDates = function (testDate) {
519
+ return options.disabledDates[testDate.format('YYYY-MM-DD')] === true;
520
+ },
521
+
522
+ isInEnabledDates = function (testDate) {
523
+ return options.enabledDates[testDate.format('YYYY-MM-DD')] === true;
524
+ },
525
+
526
+ isInDisabledHours = function (testDate) {
527
+ return options.disabledHours[testDate.format('H')] === true;
528
+ },
529
+
530
+ isInEnabledHours = function (testDate) {
531
+ return options.enabledHours[testDate.format('H')] === true;
532
+ },
533
+
534
+ isValid = function (targetMoment, granularity) {
535
+ if (!targetMoment.isValid()) {
536
+ return false;
537
+ }
538
+ if (options.disabledDates && granularity === 'd' && isInDisabledDates(targetMoment)) {
539
+ return false;
540
+ }
541
+ if (options.enabledDates && granularity === 'd' && !isInEnabledDates(targetMoment)) {
542
+ return false;
543
+ }
544
+ if (options.minDate && targetMoment.isBefore(options.minDate, granularity)) {
545
+ return false;
546
+ }
547
+ if (options.maxDate && targetMoment.isAfter(options.maxDate, granularity)) {
548
+ return false;
549
+ }
550
+ if (options.daysOfWeekDisabled && granularity === 'd' && options.daysOfWeekDisabled.indexOf(targetMoment.day()) !== -1) {
551
+ return false;
552
+ }
553
+ if (options.disabledHours && (granularity === 'h' || granularity === 'm' || granularity === 's') && isInDisabledHours(targetMoment)) {
554
+ return false;
555
+ }
556
+ if (options.enabledHours && (granularity === 'h' || granularity === 'm' || granularity === 's') && !isInEnabledHours(targetMoment)) {
557
+ return false;
558
+ }
559
+ if (options.disabledTimeIntervals && (granularity === 'h' || granularity === 'm' || granularity === 's')) {
560
+ var found = false;
561
+ $.each(options.disabledTimeIntervals, function () {
562
+ if (targetMoment.isBetween(this[0], this[1])) {
563
+ found = true;
564
+ return false;
565
+ }
566
+ });
567
+ if (found) {
568
+ return false;
569
+ }
570
+ }
571
+ return true;
572
+ },
573
+
574
+ fillMonths = function () {
575
+ var spans = [],
576
+ monthsShort = viewDate.clone().startOf('y').startOf('d');
577
+ while (monthsShort.isSame(viewDate, 'y')) {
578
+ spans.push($('<span>').attr('data-action', 'selectMonth').addClass('month').text(monthsShort.format('MMM')));
579
+ monthsShort.add(1, 'M');
580
+ }
581
+ widget.find('.datepicker-months td').empty().append(spans);
582
+ },
583
+
584
+ updateMonths = function () {
585
+ var monthsView = widget.find('.datepicker-months'),
586
+ monthsViewHeader = monthsView.find('th'),
587
+ months = monthsView.find('tbody').find('span');
588
+
589
+ monthsViewHeader.eq(0).find('span').attr('title', options.tooltips.prevYear);
590
+ monthsViewHeader.eq(1).attr('title', options.tooltips.selectYear);
591
+ monthsViewHeader.eq(2).find('span').attr('title', options.tooltips.nextYear);
592
+
593
+ monthsView.find('.disabled').removeClass('disabled');
594
 
595
+ if (!isValid(viewDate.clone().subtract(1, 'y'), 'y')) {
596
+ monthsViewHeader.eq(0).addClass('disabled');
597
+ }
598
+
599
+ monthsViewHeader.eq(1).text(viewDate.year());
600
+
601
+ if (!isValid(viewDate.clone().add(1, 'y'), 'y')) {
602
+ monthsViewHeader.eq(2).addClass('disabled');
603
+ }
604
+
605
+ months.removeClass('active');
606
+ if (date.isSame(viewDate, 'y') && !unset) {
607
+ months.eq(date.month()).addClass('active');
608
+ }
609
+
610
+ months.each(function (index) {
611
+ if (!isValid(viewDate.clone().month(index), 'M')) {
612
+ $(this).addClass('disabled');
613
+ }
614
+ });
615
+ },
616
+
617
+ updateYears = function () {
618
+ var yearsView = widget.find('.datepicker-years'),
619
+ yearsViewHeader = yearsView.find('th'),
620
+ startYear = viewDate.clone().subtract(5, 'y'),
621
+ endYear = viewDate.clone().add(6, 'y'),
622
+ html = '';
623
+
624
+ yearsViewHeader.eq(0).find('span').attr('title', options.tooltips.prevDecade);
625
+ yearsViewHeader.eq(1).attr('title', options.tooltips.selectDecade);
626
+ yearsViewHeader.eq(2).find('span').attr('title', options.tooltips.nextDecade);
627
+
628
+ yearsView.find('.disabled').removeClass('disabled');
629
+
630
+ if (options.minDate && options.minDate.isAfter(startYear, 'y')) {
631
+ yearsViewHeader.eq(0).addClass('disabled');
632
+ }
633
+
634
+ yearsViewHeader.eq(1).text(startYear.year() + '-' + endYear.year());
635
+
636
+ if (options.maxDate && options.maxDate.isBefore(endYear, 'y')) {
637
+ yearsViewHeader.eq(2).addClass('disabled');
638
+ }
639
+
640
+ while (!startYear.isAfter(endYear, 'y')) {
641
+ html += '<span data-action="selectYear" class="year' + (startYear.isSame(date, 'y') && !unset ? ' active' : '') + (!isValid(startYear, 'y') ? ' disabled' : '') + '">' + startYear.year() + '</span>';
642
+ startYear.add(1, 'y');
643
+ }
644
+
645
+ yearsView.find('td').html(html);
646
+ },
647
+
648
+ updateDecades = function () {
649
+ var decadesView = widget.find('.datepicker-decades'),
650
+ decadesViewHeader = decadesView.find('th'),
651
+ startDecade = moment({ y: viewDate.year() - (viewDate.year() % 100) - 1 }),
652
+ endDecade = startDecade.clone().add(100, 'y'),
653
+ startedAt = startDecade.clone(),
654
+ minDateDecade = false,
655
+ maxDateDecade = false,
656
+ endDecadeYear,
657
+ html = '';
658
+
659
+ decadesViewHeader.eq(0).find('span').attr('title', options.tooltips.prevCentury);
660
+ decadesViewHeader.eq(2).find('span').attr('title', options.tooltips.nextCentury);
661
+
662
+ decadesView.find('.disabled').removeClass('disabled');
663
+
664
+ if (startDecade.isSame(moment({ y: 1900 })) || (options.minDate && options.minDate.isAfter(startDecade, 'y'))) {
665
+ decadesViewHeader.eq(0).addClass('disabled');
666
+ }
667
+
668
+ decadesViewHeader.eq(1).text(startDecade.year() + '-' + endDecade.year());
669
+
670
+ if (startDecade.isSame(moment({ y: 2000 })) || (options.maxDate && options.maxDate.isBefore(endDecade, 'y'))) {
671
+ decadesViewHeader.eq(2).addClass('disabled');
672
+ }
673
+
674
+ while (!startDecade.isAfter(endDecade, 'y')) {
675
+ endDecadeYear = startDecade.year() + 12;
676
+ minDateDecade = options.minDate && options.minDate.isAfter(startDecade, 'y') && options.minDate.year() <= endDecadeYear;
677
+ maxDateDecade = options.maxDate && options.maxDate.isAfter(startDecade, 'y') && options.maxDate.year() <= endDecadeYear;
678
+ html += '<span data-action="selectDecade" class="decade' + (date.isAfter(startDecade) && date.year() <= endDecadeYear ? ' active' : '') +
679
+ (!isValid(startDecade, 'y') && !minDateDecade && !maxDateDecade ? ' disabled' : '') + '" data-selection="' + (startDecade.year() + 6) + '">' + (startDecade.year() + 1) + ' - ' + (startDecade.year() + 12) + '</span>';
680
+ startDecade.add(12, 'y');
681
+ }
682
+ html += '<span></span><span></span><span></span>'; //push the dangling block over, at least this way it's even
683
+
684
+ decadesView.find('td').html(html);
685
+ decadesViewHeader.eq(1).text((startedAt.year() + 1) + '-' + (startDecade.year()));
686
+ },
687
+
688
+ fillDate = function () {
689
+ var daysView = widget.find('.datepicker-days'),
690
+ daysViewHeader = daysView.find('th'),
691
+ currentDate,
692
+ html = [],
693
+ row,
694
+ clsNames = [],
695
+ i;
696
+
697
+ if (!hasDate()) {
698
+ return;
699
+ }
700
+
701
+ daysViewHeader.eq(0).find('span').attr('title', options.tooltips.prevMonth);
702
+ daysViewHeader.eq(1).attr('title', options.tooltips.selectMonth);
703
+ daysViewHeader.eq(2).find('span').attr('title', options.tooltips.nextMonth);
704
+
705
+ daysView.find('.disabled').removeClass('disabled');
706
+ daysViewHeader.eq(1).text(viewDate.format(options.dayViewHeaderFormat));
707
+
708
+ if (!isValid(viewDate.clone().subtract(1, 'M'), 'M')) {
709
+ daysViewHeader.eq(0).addClass('disabled');
710
+ }
711
+ if (!isValid(viewDate.clone().add(1, 'M'), 'M')) {
712
+ daysViewHeader.eq(2).addClass('disabled');
713
+ }
714
+
715
+ currentDate = viewDate.clone().startOf('M').startOf('w').startOf('d');
716
+
717
+ for (i = 0; i < 42; i++) { //always display 42 days (should show 6 weeks)
718
+ if (currentDate.weekday() === 0) {
719
+ row = $('<tr>');
720
+ if (options.calendarWeeks) {
721
+ row.append('<td class="cw">' + currentDate.week() + '</td>');
722
+ }
723
+ html.push(row);
724
+ }
725
+ clsNames = ['day'];
726
+ if (currentDate.isBefore(viewDate, 'M')) {
727
+ clsNames.push('old');
728
+ }
729
+ if (currentDate.isAfter(viewDate, 'M')) {
730
+ clsNames.push('new');
731
+ }
732
+ if (currentDate.isSame(date, 'd') && !unset) {
733
+ clsNames.push('active');
734
+ }
735
+ if (!isValid(currentDate, 'd')) {
736
+ clsNames.push('disabled');
737
+ }
738
+ if (currentDate.isSame(getMoment(), 'd')) {
739
+ clsNames.push('today');
740
+ }
741
+ if (currentDate.day() === 0 || currentDate.day() === 6) {
742
+ clsNames.push('weekend');
743
+ }
744
+ notifyEvent({
745
+ type: 'dp.classify',
746
+ date: currentDate,
747
+ classNames: clsNames
748
+ });
749
+ row.append('<td data-action="selectDay" data-day="' + currentDate.format('L') + '" class="' + clsNames.join(' ') + '">' + currentDate.date() + '</td>');
750
+ currentDate.add(1, 'd');
751
+ }
752
+
753
+ daysView.find('tbody').empty().append(html);
754
+
755
+ updateMonths();
756
+
757
+ updateYears();
758
+
759
+ updateDecades();
760
+ },
761
+
762
+ fillHours = function () {
763
+ var table = widget.find('.timepicker-hours table'),
764
+ currentHour = viewDate.clone().startOf('d'),
765
+ html = [],
766
+ row = $('<tr>');
767
+
768
+ if (viewDate.hour() > 11 && !use24Hours) {
769
+ currentHour.hour(12);
770
+ }
771
+ while (currentHour.isSame(viewDate, 'd') && (use24Hours || (viewDate.hour() < 12 && currentHour.hour() < 12) || viewDate.hour() > 11)) {
772
+ if (currentHour.hour() % 4 === 0) {
773
+ row = $('<tr>');
774
+ html.push(row);
775
+ }
776
+ row.append('<td data-action="selectHour" class="hour' + (!isValid(currentHour, 'h') ? ' disabled' : '') + '">' + currentHour.format(use24Hours ? 'HH' : 'hh') + '</td>');
777
+ currentHour.add(1, 'h');
778
+ }
779
+ table.empty().append(html);
780
+ },
781
+
782
+ fillMinutes = function () {
783
+ var table = widget.find('.timepicker-minutes table'),
784
+ currentMinute = viewDate.clone().startOf('h'),
785
+ html = [],
786
+ row = $('<tr>'),
787
+ step = options.stepping === 1 ? 5 : options.stepping;
788
+
789
+ while (viewDate.isSame(currentMinute, 'h')) {
790
+ if (currentMinute.minute() % (step * 4) === 0) {
791
+ row = $('<tr>');
792
+ html.push(row);
793
+ }
794
+ row.append('<td data-action="selectMinute" class="minute' + (!isValid(currentMinute, 'm') ? ' disabled' : '') + '">' + currentMinute.format('mm') + '</td>');
795
+ currentMinute.add(step, 'm');
796
+ }
797
+ table.empty().append(html);
798
+ },
799
+
800
+ fillSeconds = function () {
801
+ var table = widget.find('.timepicker-seconds table'),
802
+ currentSecond = viewDate.clone().startOf('m'),
803
+ html = [],
804
+ row = $('<tr>');
805
+
806
+ while (viewDate.isSame(currentSecond, 'm')) {
807
+ if (currentSecond.second() % 20 === 0) {
808
+ row = $('<tr>');
809
+ html.push(row);
810
+ }
811
+ row.append('<td data-action="selectSecond" class="second' + (!isValid(currentSecond, 's') ? ' disabled' : '') + '">' + currentSecond.format('ss') + '</td>');
812
+ currentSecond.add(5, 's');
813
+ }
814
+
815
+ table.empty().append(html);
816
+ },
817
+
818
+ fillTime = function () {
819
+ var toggle, newDate, timeComponents = widget.find('.timepicker span[data-time-component]');
820
+
821
+ if (!use24Hours) {
822
+ toggle = widget.find('.timepicker [data-action=togglePeriod]');
823
+ newDate = date.clone().add((date.hours() >= 12) ? -12 : 12, 'h');
824
+
825
+ toggle.text(date.format('A'));
826
+
827
+ if (isValid(newDate, 'h')) {
828
+ toggle.removeClass('disabled');
829
+ } else {
830
+ toggle.addClass('disabled');
831
+ }
832
+ }
833
+ timeComponents.filter('[data-time-component=hours]').text(date.format(use24Hours ? 'HH' : 'hh'));
834
+ timeComponents.filter('[data-time-component=minutes]').text(date.format('mm'));
835
+ timeComponents.filter('[data-time-component=seconds]').text(date.format('ss'));
836
+
837
+ fillHours();
838
+ fillMinutes();
839
+ fillSeconds();
840
+ },
841
+
842
+ update = function () {
843
+ if (!widget) {
844
+ return;
845
+ }
846
+ fillDate();
847
+ fillTime();
848
+ },
849
+
850
+ setValue = function (targetMoment) {
851
+ var oldDate = unset ? null : date;
852
+
853
+ // case of calling setValue(null or false)
854
+ if (!targetMoment) {
855
+ unset = true;
856
+ input.val('');
857
+ element.data('date', '');
858
+ notifyEvent({
859
+ type: 'dp.change',
860
+ date: false,
861
+ oldDate: oldDate
862
+ });
863
+ update();
864
+ return;
865
+ }
866
+
867
+ targetMoment = targetMoment.clone().locale(options.locale);
868
+
869
+ if (hasTimeZone()) {
870
+ targetMoment.tz(options.timeZone);
871
+ }
872
+
873
+ if (options.stepping !== 1) {
874
+ targetMoment.minutes((Math.round(targetMoment.minutes() / options.stepping) * options.stepping)).seconds(0);
875
+
876
+ while (options.minDate && targetMoment.isBefore(options.minDate)) {
877
+ targetMoment.add(options.stepping, 'minutes');
878
+ }
879
+ }
880
+
881
+ if (isValid(targetMoment)) {
882
+ date = targetMoment;
883
+ viewDate = date.clone();
884
+ input.val(date.format(actualFormat));
885
+ element.data('date', date.format(actualFormat));
886
+ unset = false;
887
+ update();
888
+ notifyEvent({
889
+ type: 'dp.change',
890
+ date: date.clone(),
891
+ oldDate: oldDate
892
+ });
893
+ } else {
894
+ if (!options.keepInvalid) {
895
+ input.val(unset ? '' : date.format(actualFormat));
896
+ } else {
897
+ notifyEvent({
898
+ type: 'dp.change',
899
+ date: targetMoment,
900
+ oldDate: oldDate
901
+ });
902
+ }
903
+ notifyEvent({
904
+ type: 'dp.error',
905
+ date: targetMoment,
906
+ oldDate: oldDate
907
+ });
908
+ }
909
+ },
910
+
911
+ /**
912
+ * Hides the widget. Possibly will emit dp.hide
913
+ */
914
+ hide = function () {
915
+ var transitioning = false;
916
+ if (!widget) {
917
+ return picker;
918
+ }
919
+ // Ignore event if in the middle of a picker transition
920
+ widget.find('.collapse').each(function () {
921
+ var collapseData = $(this).data('collapse');
922
+ if (collapseData && collapseData.transitioning) {
923
+ transitioning = true;
924
+ return false;
925
+ }
926
+ return true;
927
+ });
928
+ if (transitioning) {
929
+ return picker;
930
+ }
931
+ if (component && component.hasClass('btn')) {
932
+ component.toggleClass('active');
933
+ }
934
+ widget.hide();
935
+
936
+ $(window).off('resize', place);
937
+ widget.off('click', '[data-action]');
938
+ widget.off('mousedown', false);
939
+
940
+ widget.remove();
941
+ widget = false;
942
+
943
+ notifyEvent({
944
+ type: 'dp.hide',
945
+ date: date.clone()
946
+ });
947
+
948
+ input.blur();
949
+
950
+ viewDate = date.clone();
951
+
952
+ return picker;
953
+ },
954
+
955
+ clear = function () {
956
+ setValue(null);
957
+ },
958
+
959
+ parseInputDate = function (inputDate) {
960
+ if (options.parseInputDate === undefined) {
961
+ if (!moment.isMoment(inputDate) || inputDate instanceof Date) {
962
+ inputDate = getMoment(inputDate);
963
+ }
964
+ } else {
965
+ inputDate = options.parseInputDate(inputDate);
966
+ }
967
+ //inputDate.locale(options.locale);
968
+ return inputDate;
969
+ },
970
+
971
+ /********************************************************************************
972
+ *
973
+ * Widget UI interaction functions
974
+ *
975
+ ********************************************************************************/
976
+ actions = {
977
+ next: function () {
978
+ var navFnc = datePickerModes[currentViewMode].navFnc;
979
+ viewDate.add(datePickerModes[currentViewMode].navStep, navFnc);
980
+ fillDate();
981
+ viewUpdate(navFnc);
982
+ },
983
+
984
+ previous: function () {
985
+ var navFnc = datePickerModes[currentViewMode].navFnc;
986
+ viewDate.subtract(datePickerModes[currentViewMode].navStep, navFnc);
987
+ fillDate();
988
+ viewUpdate(navFnc);
989
+ },
990
 
991
+ pickerSwitch: function () {
992
+ showMode(1);
993
+ },
994
 
995
+ selectMonth: function (e) {
996
+ var month = $(e.target).closest('tbody').find('span').index($(e.target));
997
+ viewDate.month(month);
998
+ if (currentViewMode === minViewModeNumber) {
999
+ setValue(date.clone().year(viewDate.year()).month(viewDate.month()));
1000
+ if (!options.inline) {
1001
+ hide();
1002
+ }
1003
+ } else {
1004
+ showMode(-1);
1005
+ fillDate();
1006
+ }
1007
+ viewUpdate('M');
1008
+ },
1009
 
1010
+ selectYear: function (e) {
1011
+ var year = parseInt($(e.target).text(), 10) || 0;
1012
+ viewDate.year(year);
1013
+ if (currentViewMode === minViewModeNumber) {
1014
+ setValue(date.clone().year(viewDate.year()));
1015
+ if (!options.inline) {
1016
+ hide();
1017
+ }
1018
+ } else {
1019
+ showMode(-1);
1020
+ fillDate();
1021
+ }
1022
+ viewUpdate('YYYY');
1023
+ },
1024
 
1025
+ selectDecade: function (e) {
1026
+ var year = parseInt($(e.target).data('selection'), 10) || 0;
1027
+ viewDate.year(year);
1028
+ if (currentViewMode === minViewModeNumber) {
1029
+ setValue(date.clone().year(viewDate.year()));
1030
+ if (!options.inline) {
1031
+ hide();
1032
+ }
1033
+ } else {
1034
+ showMode(-1);
1035
+ fillDate();
1036
+ }
1037
+ viewUpdate('YYYY');
1038
+ },
1039
 
1040
+ selectDay: function (e) {
1041
+ var day = viewDate.clone();
1042
+ if ($(e.target).is('.old')) {
1043
+ day.subtract(1, 'M');
1044
+ }
1045
+ if ($(e.target).is('.new')) {
1046
+ day.add(1, 'M');
1047
+ }
1048
+ setValue(day.date(parseInt($(e.target).text(), 10)));
1049
+ if (!hasTime() && !options.keepOpen && !options.inline) {
1050
+ hide();
1051
+ }
1052
+ },
1053
+
1054
+ incrementHours: function () {
1055
+ var newDate = date.clone().add(1, 'h');
1056
+ if (isValid(newDate, 'h')) {
1057
+ setValue(newDate);
1058
+ }
1059
+ },
1060
+
1061
+ incrementMinutes: function () {
1062
+ var newDate = date.clone().add(options.stepping, 'm');
1063
+ if (isValid(newDate, 'm')) {
1064
+ setValue(newDate);
1065
+ }
1066
+ },
1067
+
1068
+ incrementSeconds: function () {
1069
+ var newDate = date.clone().add(1, 's');
1070
+ if (isValid(newDate, 's')) {
1071
+ setValue(newDate);
1072
+ }
1073
+ },
1074
+
1075
+ decrementHours: function () {
1076
+ var newDate = date.clone().subtract(1, 'h');
1077
+ if (isValid(newDate, 'h')) {
1078
+ setValue(newDate);
1079
+ }
1080
+ },
1081
+
1082
+ decrementMinutes: function () {
1083
+ var newDate = date.clone().subtract(options.stepping, 'm');
1084
+ if (isValid(newDate, 'm')) {
1085
+ setValue(newDate);
1086
+ }
1087
+ },
1088
+
1089
+ decrementSeconds: function () {
1090
+ var newDate = date.clone().subtract(1, 's');
1091
+ if (isValid(newDate, 's')) {
1092
+ setValue(newDate);
1093
+ }
1094
+ },
1095
+
1096
+ togglePeriod: function () {
1097
+ setValue(date.clone().add((date.hours() >= 12) ? -12 : 12, 'h'));
1098
+ },
1099
+
1100
+ togglePicker: function (e) {
1101
+ var $this = $(e.target),
1102
+ $parent = $this.closest('ul'),
1103
+ expanded = $parent.find('.in'),
1104
+ closed = $parent.find('.collapse:not(.in)'),
1105
+ collapseData;
1106
+
1107
+ if (expanded && expanded.length) {
1108
+ collapseData = expanded.data('collapse');
1109
+ if (collapseData && collapseData.transitioning) {
1110
+ return;
1111
+ }
1112
+ if (expanded.collapse) { // if collapse plugin is available through bootstrap.js then use it
1113
+ expanded.collapse('hide');
1114
+ closed.collapse('show');
1115
+ } else { // otherwise just toggle in class on the two views
1116
+ expanded.removeClass('in');
1117
+ closed.addClass('in');
1118
+ }
1119
+ if ($this.is('span')) {
1120
+ $this.toggleClass(options.icons.time + ' ' + options.icons.date);
1121
+ } else {
1122
+ $this.find('span').toggleClass(options.icons.time + ' ' + options.icons.date);
1123
+ }
1124
+
1125
+ // NOTE: uncomment if toggled state will be restored in show()
1126
+ //if (component) {
1127
+ // component.find('span').toggleClass(options.icons.time + ' ' + options.icons.date);
1128
+ //}
1129
+ }
1130
+ },
1131
+
1132
+ showPicker: function () {
1133
+ widget.find('.timepicker > div:not(.timepicker-picker)').hide();
1134
+ widget.find('.timepicker .timepicker-picker').show();
1135
+ },
1136
+
1137
+ showHours: function () {
1138
+ widget.find('.timepicker .timepicker-picker').hide();
1139
+ widget.find('.timepicker .timepicker-hours').show();
1140
+ },
1141
+
1142
+ showMinutes: function () {
1143
+ widget.find('.timepicker .timepicker-picker').hide();
1144
+ widget.find('.timepicker .timepicker-minutes').show();
1145
+ },
1146
+
1147
+ showSeconds: function () {
1148
+ widget.find('.timepicker .timepicker-picker').hide();
1149
+ widget.find('.timepicker .timepicker-seconds').show();
1150
+ },
1151
+
1152
+ selectHour: function (e) {
1153
+ var hour = parseInt($(e.target).text(), 10);
1154
+
1155
+ if (!use24Hours) {
1156
+ if (date.hours() >= 12) {
1157
+ if (hour !== 12) {
1158
+ hour += 12;
1159
+ }
1160
+ } else {
1161
+ if (hour === 12) {
1162
+ hour = 0;
1163
+ }
1164
+ }
1165
+ }
1166
+ setValue(date.clone().hours(hour));
1167
+ actions.showPicker.call(picker);
1168
+ },
1169
+
1170
+ selectMinute: function (e) {
1171
+ setValue(date.clone().minutes(parseInt($(e.target).text(), 10)));
1172
+ actions.showPicker.call(picker);
1173
+ },
1174
+
1175
+ selectSecond: function (e) {
1176
+ setValue(date.clone().seconds(parseInt($(e.target).text(), 10)));
1177
+ actions.showPicker.call(picker);
1178
+ },
1179
+
1180
+ clear: clear,
1181
+
1182
+ today: function () {
1183
+ var todaysDate = getMoment();
1184
+ if (isValid(todaysDate, 'd')) {
1185
+ setValue(todaysDate);
1186
+ }
1187
+ },
1188
+
1189
+ close: hide
1190
+ },
1191
+
1192
+ doAction = function (e) {
1193
+ if ($(e.currentTarget).is('.disabled')) {
1194
+ return false;
1195
+ }
1196
+ actions[$(e.currentTarget).data('action')].apply(picker, arguments);
1197
+ return false;
1198
+ },
1199
+
1200
+ /**
1201
+ * Shows the widget. Possibly will emit dp.show and dp.change
1202
+ */
1203
+ show = function () {
1204
+ var currentMoment,
1205
+ useCurrentGranularity = {
1206
+ 'year': function (m) {
1207
+ return m.month(0).date(1).hours(0).seconds(0).minutes(0);
1208
+ },
1209
+ 'month': function (m) {
1210
+ return m.date(1).hours(0).seconds(0).minutes(0);
1211
+ },
1212
+ 'day': function (m) {
1213
+ return m.hours(0).seconds(0).minutes(0);
1214
+ },
1215
+ 'hour': function (m) {
1216
+ return m.seconds(0).minutes(0);
1217
+ },
1218
+ 'minute': function (m) {
1219
+ return m.seconds(0);
1220
+ }
1221
+ };
1222
+
1223
+ if (input.prop('disabled') || (!options.ignoreReadonly && input.prop('readonly')) || widget) {
1224
+ return picker;
1225
+ }
1226
+ if (input.val() !== undefined && input.val().trim().length !== 0) {
1227
+ setValue(parseInputDate(input.val().trim()));
1228
+ } else if (unset && options.useCurrent && (options.inline || (input.is('input') && input.val().trim().length === 0))) {
1229
+ currentMoment = getMoment();
1230
+ if (typeof options.useCurrent === 'string') {
1231
+ currentMoment = useCurrentGranularity[options.useCurrent](currentMoment);
1232
+ }
1233
+ setValue(currentMoment);
1234
+ }
1235
+ widget = getTemplate();
1236
+
1237
+ fillDow();
1238
+ fillMonths();
1239
+
1240
+ widget.find('.timepicker-hours').hide();
1241
+ widget.find('.timepicker-minutes').hide();
1242
+ widget.find('.timepicker-seconds').hide();
1243
+
1244
+ update();
1245
+ showMode();
1246
+
1247
+ $(window).on('resize', place);
1248
+ widget.on('click', '[data-action]', doAction); // this handles clicks on the widget
1249
+ widget.on('mousedown', false);
1250
+
1251
+ if (component && component.hasClass('btn')) {
1252
+ component.toggleClass('active');
1253
+ }
1254
+ place();
1255
+ widget.show();
1256
+ if (options.focusOnShow && !input.is(':focus')) {
1257
+ input.focus();
1258
+ }
1259
+
1260
+ notifyEvent({
1261
+ type: 'dp.show'
1262
+ });
1263
+ return picker;
1264
+ },
1265
+
1266
+ /**
1267
+ * Shows or hides the widget
1268
+ */
1269
+ toggle = function () {
1270
+ return (widget ? hide() : show());
1271
+ },
1272
+
1273
+ keydown = function (e) {
1274
+ var handler = null,
1275
+ index,
1276
+ index2,
1277
+ pressedKeys = [],
1278
+ pressedModifiers = {},
1279
+ currentKey = e.which,
1280
+ keyBindKeys,
1281
+ allModifiersPressed,
1282
+ pressed = 'p';
1283
+
1284
+ keyState[currentKey] = pressed;
1285
+
1286
+ for (index in keyState) {
1287
+ if (keyState.hasOwnProperty(index) && keyState[index] === pressed) {
1288
+ pressedKeys.push(index);
1289
+ if (parseInt(index, 10) !== currentKey) {
1290
+ pressedModifiers[index] = true;
1291
+ }
1292
+ }
1293
+ }
1294
+
1295
+ for (index in options.keyBinds) {
1296
+ if (options.keyBinds.hasOwnProperty(index) && typeof (options.keyBinds[index]) === 'function') {
1297
+ keyBindKeys = index.split(' ');
1298
+ if (keyBindKeys.length === pressedKeys.length && keyMap[currentKey] === keyBindKeys[keyBindKeys.length - 1]) {
1299
+ allModifiersPressed = true;
1300
+ for (index2 = keyBindKeys.length - 2; index2 >= 0; index2--) {
1301
+ if (!(keyMap[keyBindKeys[index2]] in pressedModifiers)) {
1302
+ allModifiersPressed = false;
1303
+ break;
1304
+ }
1305
+ }
1306
+ if (allModifiersPressed) {
1307
+ handler = options.keyBinds[index];
1308
+ break;
1309
+ }
1310
+ }
1311
+ }
1312
+ }
1313
+
1314
+ if (handler) {
1315
+ handler.call(picker, widget);
1316
+ e.stopPropagation();
1317
+ e.preventDefault();
1318
+ }
1319
+ },
1320
+
1321
+ keyup = function (e) {
1322
+ keyState[e.which] = 'r';
1323
+ e.stopPropagation();
1324
+ e.preventDefault();
1325
+ },
1326
+
1327
+ change = function (e) {
1328
+ var val = $(e.target).val().trim(),
1329
+ parsedDate = val ? parseInputDate(val) : null;
1330
+ setValue(parsedDate);
1331
+ e.stopImmediatePropagation();
1332
+ return false;
1333
+ },
1334
+
1335
+ attachDatePickerElementEvents = function () {
1336
+ input.on({
1337
+ 'change': change,
1338
+ 'blur': options.debug ? '' : hide,
1339
+ 'keydown': keydown,
1340
+ 'keyup': keyup,
1341
+ 'focus': options.allowInputToggle ? show : ''
1342
+ });
1343
+
1344
+ if (element.is('input')) {
1345
+ input.on({
1346
+ 'focus': show
1347
+ });
1348
+ } else if (component) {
1349
+ component.on('click', toggle);
1350
+ component.on('mousedown', false);
1351
+ }
1352
+ },
1353
+
1354
+ detachDatePickerElementEvents = function () {
1355
+ input.off({
1356
+ 'change': change,
1357
+ 'blur': blur,
1358
+ 'keydown': keydown,
1359
+ 'keyup': keyup,
1360
+ 'focus': options.allowInputToggle ? hide : ''
1361
+ });
1362
+
1363
+ if (element.is('input')) {
1364
+ input.off({
1365
+ 'focus': show
1366
+ });
1367
+ } else if (component) {
1368
+ component.off('click', toggle);
1369
+ component.off('mousedown', false);
1370
+ }
1371
+ },
1372
+
1373
+ indexGivenDates = function (givenDatesArray) {
1374
+ // Store given enabledDates and disabledDates as keys.
1375
+ // This way we can check their existence in O(1) time instead of looping through whole array.
1376
+ // (for example: options.enabledDates['2014-02-27'] === true)
1377
+ var givenDatesIndexed = {};
1378
+ $.each(givenDatesArray, function () {
1379
+ var dDate = parseInputDate(this);
1380
+ if (dDate.isValid()) {
1381
+ givenDatesIndexed[dDate.format('YYYY-MM-DD')] = true;
1382
+ }
1383
+ });
1384
+ return (Object.keys(givenDatesIndexed).length) ? givenDatesIndexed : false;
1385
+ },
1386
+
1387
+ indexGivenHours = function (givenHoursArray) {
1388
+ // Store given enabledHours and disabledHours as keys.
1389
+ // This way we can check their existence in O(1) time instead of looping through whole array.
1390
+ // (for example: options.enabledHours['2014-02-27'] === true)
1391
+ var givenHoursIndexed = {};
1392
+ $.each(givenHoursArray, function () {
1393
+ givenHoursIndexed[this] = true;
1394
+ });
1395
+ return (Object.keys(givenHoursIndexed).length) ? givenHoursIndexed : false;
1396
+ },
1397
+
1398
+ initFormatting = function () {
1399
+ var format = options.format || 'L LT';
1400
+
1401
+ actualFormat = format.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput) {
1402
+ var newinput = date.localeData().longDateFormat(formatInput) || formatInput;
1403
+ return newinput.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput2) { //temp fix for #740
1404
+ return date.localeData().longDateFormat(formatInput2) || formatInput2;
1405
+ });
1406
+ });
1407
+
1408
+
1409
+ parseFormats = options.extraFormats ? options.extraFormats.slice() : [];
1410
+ if (parseFormats.indexOf(format) < 0 && parseFormats.indexOf(actualFormat) < 0) {
1411
+ parseFormats.push(actualFormat);
1412
+ }
1413
+
1414
+ use24Hours = (actualFormat.toLowerCase().indexOf('a') < 1 && actualFormat.replace(/\[.*?\]/g, '').indexOf('h') < 1);
1415
+
1416
+ if (isEnabled('y')) {
1417
+ minViewModeNumber = 2;
1418
+ }
1419
+ if (isEnabled('M')) {
1420
+ minViewModeNumber = 1;
1421
+ }
1422
+ if (isEnabled('d')) {
1423
+ minViewModeNumber = 0;
1424
+ }
1425
+
1426
+ currentViewMode = Math.max(minViewModeNumber, currentViewMode);
1427
+
1428
+ if (!unset) {
1429
+ setValue(date);
1430
+ }
1431
+ };
1432
+
1433
+ /********************************************************************************
1434
+ *
1435
+ * Public API functions
1436
+ * =====================
1437
+ *
1438
+ * Important: Do not expose direct references to private objects or the options
1439
+ * object to the outer world. Always return a clone when returning values or make
1440
+ * a clone when setting a private variable.
1441
+ *
1442
+ ********************************************************************************/
1443
+ picker.destroy = function () {
1444
+ ///<summary>Destroys the widget and removes all attached event listeners</summary>
1445
+ hide();
1446
+ detachDatePickerElementEvents();
1447
+ element.removeData('DateTimePicker');
1448
+ element.removeData('date');
1449
+ };
1450
+
1451
+ picker.toggle = toggle;
1452
+
1453
+ picker.show = show;
1454
+
1455
+ picker.hide = hide;
1456
+
1457
+ picker.disable = function () {
1458
+ ///<summary>Disables the input element, the component is attached to, by adding a disabled="true" attribute to it.
1459
+ ///If the widget was visible before that call it is hidden. Possibly emits dp.hide</summary>
1460
+ hide();
1461
+ if (component && component.hasClass('btn')) {
1462
+ component.addClass('disabled');
1463
+ }
1464
+ input.prop('disabled', true);
1465
+ return picker;
1466
+ };
1467
+
1468
+ picker.enable = function () {
1469
+ ///<summary>Enables the input element, the component is attached to, by removing disabled attribute from it.</summary>
1470
+ if (component && component.hasClass('btn')) {
1471
+ component.removeClass('disabled');
1472
+ }
1473
+ input.prop('disabled', false);
1474
+ return picker;
1475
+ };
1476
+
1477
+ picker.ignoreReadonly = function (ignoreReadonly) {
1478
+ if (arguments.length === 0) {
1479
+ return options.ignoreReadonly;
1480
+ }
1481
+ if (typeof ignoreReadonly !== 'boolean') {
1482
+ throw new TypeError('ignoreReadonly () expects a boolean parameter');
1483
+ }
1484
+ options.ignoreReadonly = ignoreReadonly;
1485
+ return picker;
1486
+ };
1487
+
1488
+ picker.options = function (newOptions) {
1489
+ if (arguments.length === 0) {
1490
+ return $.extend(true, {}, options);
1491
+ }
1492
+
1493
+ if (!(newOptions instanceof Object)) {
1494
+ throw new TypeError('options() options parameter should be an object');
1495
+ }
1496
+ $.extend(true, options, newOptions);
1497
+ $.each(options, function (key, value) {
1498
+ if (picker[key] !== undefined) {
1499
+ picker[key](value);
1500
+ } else {
1501
+ throw new TypeError('option ' + key + ' is not recognized!');
1502
+ }
1503
+ });
1504
+ return picker;
1505
+ };
1506
+
1507
+ picker.date = function (newDate) {
1508
+ ///<signature helpKeyword="$.fn.datetimepicker.date">
1509
+ ///<summary>Returns the component's model current date, a moment object or null if not set.</summary>
1510
+ ///<returns type="Moment">date.clone()</returns>
1511
+ ///</signature>
1512
+ ///<signature>
1513
+ ///<summary>Sets the components model current moment to it. Passing a null value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration.</summary>
1514
+ ///<param name="newDate" locid="$.fn.datetimepicker.date_p:newDate">Takes string, Date, moment, null parameter.</param>
1515
+ ///</signature>
1516
+ if (arguments.length === 0) {
1517
+ if (unset) {
1518
+ return null;
1519
+ }
1520
+ return date.clone();
1521
+ }
1522
+
1523
+ if (newDate !== null && typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) {
1524
+ throw new TypeError('date() parameter must be one of [null, string, moment or Date]');
1525
+ }
1526
+
1527
+ setValue(newDate === null ? null : parseInputDate(newDate));
1528
+ return picker;
1529
+ };
1530
+
1531
+ picker.format = function (newFormat) {
1532
+ ///<summary>test su</summary>
1533
+ ///<param name="newFormat">info about para</param>
1534
+ ///<returns type="string|boolean">returns foo</returns>
1535
+ if (arguments.length === 0) {
1536
+ return options.format;
1537
+ }
1538
+
1539
+ if ((typeof newFormat !== 'string') && ((typeof newFormat !== 'boolean') || (newFormat !== false))) {
1540
+ throw new TypeError('format() expects a string or boolean:false parameter ' + newFormat);
1541
+ }
1542
+
1543
+ options.format = newFormat;
1544
+ if (actualFormat) {
1545
+ initFormatting(); // reinit formatting
1546
+ }
1547
+ return picker;
1548
+ };
1549
+
1550
+ picker.timeZone = function (newZone) {
1551
+ if (arguments.length === 0) {
1552
+ return options.timeZone;
1553
+ }
1554
+
1555
+ if (typeof newZone !== 'string') {
1556
+ throw new TypeError('newZone() expects a string parameter');
1557
+ }
1558
+
1559
+ options.timeZone = newZone;
1560
+
1561
+ return picker;
1562
+ };
1563
+
1564
+ picker.dayViewHeaderFormat = function (newFormat) {
1565
+ if (arguments.length === 0) {
1566
+ return options.dayViewHeaderFormat;
1567
+ }
1568
+
1569
+ if (typeof newFormat !== 'string') {
1570
+ throw new TypeError('dayViewHeaderFormat() expects a string parameter');
1571
+ }
1572
+
1573
+ options.dayViewHeaderFormat = newFormat;
1574
+ return picker;
1575
+ };
1576
+
1577
+ picker.extraFormats = function (formats) {
1578
+ if (arguments.length === 0) {
1579
+ return options.extraFormats;
1580
+ }
1581
+
1582
+ if (formats !== false && !(formats instanceof Array)) {
1583
+ throw new TypeError('extraFormats() expects an array or false parameter');
1584
+ }
1585
+
1586
+ options.extraFormats = formats;
1587
+ if (parseFormats) {
1588
+ initFormatting(); // reinit formatting
1589
+ }
1590
+ return picker;
1591
+ };
1592
+
1593
+ picker.disabledDates = function (dates) {
1594
+ ///<signature helpKeyword="$.fn.datetimepicker.disabledDates">
1595
+ ///<summary>Returns an array with the currently set disabled dates on the component.</summary>
1596
+ ///<returns type="array">options.disabledDates</returns>
1597
+ ///</signature>
1598
+ ///<signature>
1599
+ ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of
1600
+ ///options.enabledDates if such exist.</summary>
1601
+ ///<param name="dates" locid="$.fn.datetimepicker.disabledDates_p:dates">Takes an [ string or Date or moment ] of values and allows the user to select only from those days.</param>
1602
+ ///</signature>
1603
+ if (arguments.length === 0) {
1604
+ return (options.disabledDates ? $.extend({}, options.disabledDates) : options.disabledDates);
1605
+ }
1606
+
1607
+ if (!dates) {
1608
+ options.disabledDates = false;
1609
+ update();
1610
+ return picker;
1611
+ }
1612
+ if (!(dates instanceof Array)) {
1613
+ throw new TypeError('disabledDates() expects an array parameter');
1614
+ }
1615
+ options.disabledDates = indexGivenDates(dates);
1616
+ options.enabledDates = false;
1617
+ update();
1618
+ return picker;
1619
+ };
1620
+
1621
+ picker.enabledDates = function (dates) {
1622
+ ///<signature helpKeyword="$.fn.datetimepicker.enabledDates">
1623
+ ///<summary>Returns an array with the currently set enabled dates on the component.</summary>
1624
+ ///<returns type="array">options.enabledDates</returns>
1625
+ ///</signature>
1626
+ ///<signature>
1627
+ ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of options.disabledDates if such exist.</summary>
1628
+ ///<param name="dates" locid="$.fn.datetimepicker.enabledDates_p:dates">Takes an [ string or Date or moment ] of values and allows the user to select only from those days.</param>
1629
+ ///</signature>
1630
+ if (arguments.length === 0) {
1631
+ return (options.enabledDates ? $.extend({}, options.enabledDates) : options.enabledDates);
1632
+ }
1633
+
1634
+ if (!dates) {
1635
+ options.enabledDates = false;
1636
+ update();
1637
+ return picker;
1638
+ }
1639
+ if (!(dates instanceof Array)) {
1640
+ throw new TypeError('enabledDates() expects an array parameter');
1641
+ }
1642
+ options.enabledDates = indexGivenDates(dates);
1643
+ options.disabledDates = false;
1644
+ update();
1645
+ return picker;
1646
+ };
1647
+
1648
+ picker.daysOfWeekDisabled = function (daysOfWeekDisabled) {
1649
+ if (arguments.length === 0) {
1650
+ return options.daysOfWeekDisabled.splice(0);
1651
+ }
1652
+
1653
+ if ((typeof daysOfWeekDisabled === 'boolean') && !daysOfWeekDisabled) {
1654
+ options.daysOfWeekDisabled = false;
1655
+ update();
1656
+ return picker;
1657
+ }
1658
+
1659
+ if (!(daysOfWeekDisabled instanceof Array)) {
1660
+ throw new TypeError('daysOfWeekDisabled() expects an array parameter');
1661
+ }
1662
+ options.daysOfWeekDisabled = daysOfWeekDisabled.reduce(function (previousValue, currentValue) {
1663
+ currentValue = parseInt(currentValue, 10);
1664
+ if (currentValue > 6 || currentValue < 0 || isNaN(currentValue)) {
1665
+ return previousValue;
1666
+ }
1667
+ if (previousValue.indexOf(currentValue) === -1) {
1668
+ previousValue.push(currentValue);
1669
+ }
1670
+ return previousValue;
1671
+ }, []).sort();
1672
+ if (options.useCurrent && !options.keepInvalid) {
1673
+ var tries = 0;
1674
+ while (!isValid(date, 'd')) {
1675
+ date.add(1, 'd');
1676
+ if (tries === 31) {
1677
+ throw 'Tried 31 times to find a valid date';
1678
+ }
1679
+ tries++;
1680
+ }
1681
+ setValue(date);
1682
+ }
1683
+ update();
1684
+ return picker;
1685
+ };
1686
+
1687
+ picker.maxDate = function (maxDate) {
1688
+ if (arguments.length === 0) {
1689
+ return options.maxDate ? options.maxDate.clone() : options.maxDate;
1690
+ }
1691
+
1692
+ if ((typeof maxDate === 'boolean') && maxDate === false) {
1693
+ options.maxDate = false;
1694
+ update();
1695
+ return picker;
1696
+ }
1697
+
1698
+ if (typeof maxDate === 'string') {
1699
+ if (maxDate === 'now' || maxDate === 'moment') {
1700
+ maxDate = getMoment();
1701
+ }
1702
+ }
1703
+
1704
+ var parsedDate = parseInputDate(maxDate);
1705
+
1706
+ if (!parsedDate.isValid()) {
1707
+ throw new TypeError('maxDate() Could not parse date parameter: ' + maxDate);
1708
+ }
1709
+ if (options.minDate && parsedDate.isBefore(options.minDate)) {
1710
+ throw new TypeError('maxDate() date parameter is before options.minDate: ' + parsedDate.format(actualFormat));
1711
+ }
1712
+ options.maxDate = parsedDate;
1713
+ if (options.useCurrent && !options.keepInvalid && date.isAfter(maxDate)) {
1714
+ setValue(options.maxDate);
1715
+ }
1716
+ if (viewDate.isAfter(parsedDate)) {
1717
+ viewDate = parsedDate.clone().subtract(options.stepping, 'm');
1718
+ }
1719
+ update();
1720
+ return picker;
1721
+ };
1722
+
1723
+ picker.minDate = function (minDate) {
1724
+ if (arguments.length === 0) {
1725
+ return options.minDate ? options.minDate.clone() : options.minDate;
1726
+ }
1727
+
1728
+ if ((typeof minDate === 'boolean') && minDate === false) {
1729
+ options.minDate = false;
1730
+ update();
1731
+ return picker;
1732
+ }
1733
+
1734
+ if (typeof minDate === 'string') {
1735
+ if (minDate === 'now' || minDate === 'moment') {
1736
+ minDate = getMoment();
1737
+ }
1738
+ }
1739
+
1740
+ var parsedDate = parseInputDate(minDate);
1741
+
1742
+ if (!parsedDate.isValid()) {
1743
+ throw new TypeError('minDate() Could not parse date parameter: ' + minDate);
1744
+ }
1745
+ if (options.maxDate && parsedDate.isAfter(options.maxDate)) {
1746
+ throw new TypeError('minDate() date parameter is after options.maxDate: ' + parsedDate.format(actualFormat));
1747
+ }
1748
+ options.minDate = parsedDate;
1749
+ if (options.useCurrent && !options.keepInvalid && date.isBefore(minDate)) {
1750
+ setValue(options.minDate);
1751
+ }
1752
+ if (viewDate.isBefore(parsedDate)) {
1753
+ viewDate = parsedDate.clone().add(options.stepping, 'm');
1754
+ }
1755
+ update();
1756
+ return picker;
1757
+ };
1758
+
1759
+ picker.defaultDate = function (defaultDate) {
1760
+ ///<signature helpKeyword="$.fn.datetimepicker.defaultDate">
1761
+ ///<summary>Returns a moment with the options.defaultDate option configuration or false if not set</summary>
1762
+ ///<returns type="Moment">date.clone()</returns>
1763
+ ///</signature>
1764
+ ///<signature>
1765
+ ///<summary>Will set the picker's inital date. If a boolean:false value is passed the options.defaultDate parameter is cleared.</summary>
1766
+ ///<param name="defaultDate" locid="$.fn.datetimepicker.defaultDate_p:defaultDate">Takes a string, Date, moment, boolean:false</param>
1767
+ ///</signature>
1768
+ if (arguments.length === 0) {
1769
+ return options.defaultDate ? options.defaultDate.clone() : options.defaultDate;
1770
+ }
1771
+ if (!defaultDate) {
1772
+ options.defaultDate = false;
1773
+ return picker;
1774
+ }
1775
+
1776
+ if (typeof defaultDate === 'string') {
1777
+ if (defaultDate === 'now' || defaultDate === 'moment') {
1778
+ defaultDate = getMoment();
1779
+ } else {
1780
+ defaultDate = getMoment(defaultDate);
1781
+ }
1782
+ }
1783
+
1784
+ var parsedDate = parseInputDate(defaultDate);
1785
+ if (!parsedDate.isValid()) {
1786
+ throw new TypeError('defaultDate() Could not parse date parameter: ' + defaultDate);
1787
+ }
1788
+ if (!isValid(parsedDate)) {
1789
+ throw new TypeError('defaultDate() date passed is invalid according to component setup validations');
1790
+ }
1791
+
1792
+ options.defaultDate = parsedDate;
1793
+
1794
+ if ((options.defaultDate && options.inline) || input.val().trim() === '') {
1795
+ setValue(options.defaultDate);
1796
+ }
1797
+ return picker;
1798
+ };
1799
+
1800
+ picker.locale = function (locale) {
1801
+ if (arguments.length === 0) {
1802
+ return options.locale;
1803
+ }
1804
+
1805
+ if (!moment.localeData(locale)) {
1806
+ throw new TypeError('locale() locale ' + locale + ' is not loaded from moment locales!');
1807
+ }
1808
+
1809
+ options.locale = locale;
1810
+ date.locale(options.locale);
1811
+ viewDate.locale(options.locale);
1812
+
1813
+ if (actualFormat) {
1814
+ initFormatting(); // reinit formatting
1815
+ }
1816
+ if (widget) {
1817
+ hide();
1818
+ show();
1819
+ }
1820
+ return picker;
1821
+ };
1822
+
1823
+ picker.stepping = function (stepping) {
1824
+ if (arguments.length === 0) {
1825
+ return options.stepping;
1826
+ }
1827
+
1828
+ stepping = parseInt(stepping, 10);
1829
+ if (isNaN(stepping) || stepping < 1) {
1830
+ stepping = 1;
1831
+ }
1832
+ options.stepping = stepping;
1833
+ return picker;
1834
+ };
1835
+
1836
+ picker.useCurrent = function (useCurrent) {
1837
+ var useCurrentOptions = ['year', 'month', 'day', 'hour', 'minute'];
1838
+ if (arguments.length === 0) {
1839
+ return options.useCurrent;
1840
+ }
1841
+
1842
+ if ((typeof useCurrent !== 'boolean') && (typeof useCurrent !== 'string')) {
1843
+ throw new TypeError('useCurrent() expects a boolean or string parameter');
1844
+ }
1845
+ if (typeof useCurrent === 'string' && useCurrentOptions.indexOf(useCurrent.toLowerCase()) === -1) {
1846
+ throw new TypeError('useCurrent() expects a string parameter of ' + useCurrentOptions.join(', '));
1847
+ }
1848
+ options.useCurrent = useCurrent;
1849
+ return picker;
1850
+ };
1851
+
1852
+ picker.collapse = function (collapse) {
1853
+ if (arguments.length === 0) {
1854
+ return options.collapse;
1855
+ }
1856
+
1857
+ if (typeof collapse !== 'boolean') {
1858
+ throw new TypeError('collapse() expects a boolean parameter');
1859
+ }
1860
+ if (options.collapse === collapse) {
1861
+ return picker;
1862
+ }
1863
+ options.collapse = collapse;
1864
+ if (widget) {
1865
+ hide();
1866
+ show();
1867
+ }
1868
+ return picker;
1869
+ };
1870
+
1871
+ picker.icons = function (icons) {
1872
+ if (arguments.length === 0) {
1873
+ return $.extend({}, options.icons);
1874
+ }
1875
+
1876
+ if (!(icons instanceof Object)) {
1877
+ throw new TypeError('icons() expects parameter to be an Object');
1878
+ }
1879
+ $.extend(options.icons, icons);
1880
+ if (widget) {
1881
+ hide();
1882
+ show();
1883
+ }
1884
+ return picker;
1885
+ };
1886
+
1887
+ picker.tooltips = function (tooltips) {
1888
+ if (arguments.length === 0) {
1889
+ return $.extend({}, options.tooltips);
1890
+ }
1891
+
1892
+ if (!(tooltips instanceof Object)) {
1893
+ throw new TypeError('tooltips() expects parameter to be an Object');
1894
+ }
1895
+ $.extend(options.tooltips, tooltips);
1896
+ if (widget) {
1897
+ hide();
1898
+ show();
1899
+ }
1900
+ return picker;
1901
+ };
1902
+
1903
+ picker.useStrict = function (useStrict) {
1904
+ if (arguments.length === 0) {
1905
+ return options.useStrict;
1906
+ }
1907
+
1908
+ if (typeof useStrict !== 'boolean') {
1909
+ throw new TypeError('useStrict() expects a boolean parameter');
1910
+ }
1911
+ options.useStrict = useStrict;
1912
+ return picker;
1913
+ };
1914
+
1915
+ picker.sideBySide = function (sideBySide) {
1916
+ if (arguments.length === 0) {
1917
+ return options.sideBySide;
1918
+ }
1919
+
1920
+ if (typeof sideBySide !== 'boolean') {
1921
+ throw new TypeError('sideBySide() expects a boolean parameter');
1922
+ }
1923
+ options.sideBySide = sideBySide;
1924
+ if (widget) {
1925
+ hide();
1926
+ show();
1927
+ }
1928
+ return picker;
1929
+ };
1930
+
1931
+ picker.viewMode = function (viewMode) {
1932
+ if (arguments.length === 0) {
1933
+ return options.viewMode;
1934
+ }
1935
+
1936
+ if (typeof viewMode !== 'string') {
1937
+ throw new TypeError('viewMode() expects a string parameter');
1938
+ }
1939
+
1940
+ if (viewModes.indexOf(viewMode) === -1) {
1941
+ throw new TypeError('viewMode() parameter must be one of (' + viewModes.join(', ') + ') value');
1942
+ }
1943
+
1944
+ options.viewMode = viewMode;
1945
+ currentViewMode = Math.max(viewModes.indexOf(viewMode), minViewModeNumber);
1946
+
1947
+ showMode();
1948
+ return picker;
1949
+ };
1950
+
1951
+ picker.toolbarPlacement = function (toolbarPlacement) {
1952
+ if (arguments.length === 0) {
1953
+ return options.toolbarPlacement;
1954
+ }
1955
+
1956
+ if (typeof toolbarPlacement !== 'string') {
1957
+ throw new TypeError('toolbarPlacement() expects a string parameter');
1958
+ }
1959
+ if (toolbarPlacements.indexOf(toolbarPlacement) === -1) {
1960
+ throw new TypeError('toolbarPlacement() parameter must be one of (' + toolbarPlacements.join(', ') + ') value');
1961
+ }
1962
+ options.toolbarPlacement = toolbarPlacement;
1963
 
1964
+ if (widget) {
1965
+ hide();
1966
+ show();
1967
+ }
1968
+ return picker;
1969
+ };
1970
 
1971
+ picker.widgetPositioning = function (widgetPositioning) {
1972
+ if (arguments.length === 0) {
1973
+ return $.extend({}, options.widgetPositioning);
1974
+ }
 
 
1975
 
1976
+ if (({}).toString.call(widgetPositioning) !== '[object Object]') {
1977
+ throw new TypeError('widgetPositioning() expects an object variable');
1978
+ }
1979
+ if (widgetPositioning.horizontal) {
1980
+ if (typeof widgetPositioning.horizontal !== 'string') {
1981
+ throw new TypeError('widgetPositioning() horizontal variable must be a string');
1982
+ }
1983
+ widgetPositioning.horizontal = widgetPositioning.horizontal.toLowerCase();
1984
+ if (horizontalModes.indexOf(widgetPositioning.horizontal) === -1) {
1985
+ throw new TypeError('widgetPositioning() expects horizontal parameter to be one of (' + horizontalModes.join(', ') + ')');
1986
+ }
1987
+ options.widgetPositioning.horizontal = widgetPositioning.horizontal;
1988
+ }
1989
+ if (widgetPositioning.vertical) {
1990
+ if (typeof widgetPositioning.vertical !== 'string') {
1991
+ throw new TypeError('widgetPositioning() vertical variable must be a string');
1992
  }
1993
+ widgetPositioning.vertical = widgetPositioning.vertical.toLowerCase();
1994
+ if (verticalModes.indexOf(widgetPositioning.vertical) === -1) {
1995
+ throw new TypeError('widgetPositioning() expects vertical parameter to be one of (' + verticalModes.join(', ') + ')');
1996
  }
1997
+ options.widgetPositioning.vertical = widgetPositioning.vertical;
1998
  }
1999
+ update();
2000
+ return picker;
2001
+ };
2002
 
2003
+ picker.calendarWeeks = function (calendarWeeks) {
2004
+ if (arguments.length === 0) {
2005
+ return options.calendarWeeks;
2006
+ }
2007
 
2008
+ if (typeof calendarWeeks !== 'boolean') {
2009
+ throw new TypeError('calendarWeeks() expects parameter to be a boolean value');
 
 
 
 
 
 
 
 
 
 
2010
  }
 
2011
 
2012
+ options.calendarWeeks = calendarWeeks;
2013
+ update();
2014
+ return picker;
2015
+ };
2016
 
2017
+ picker.showTodayButton = function (showTodayButton) {
2018
+ if (arguments.length === 0) {
2019
+ return options.showTodayButton;
2020
  }
2021
+
2022
+ if (typeof showTodayButton !== 'boolean') {
2023
+ throw new TypeError('showTodayButton() expects a boolean parameter');
 
 
2024
  }
2025
 
2026
+ options.showTodayButton = showTodayButton;
2027
+ if (widget) {
2028
+ hide();
2029
+ show();
2030
+ }
2031
+ return picker;
2032
+ };
2033
 
2034
+ picker.showClear = function (showClear) {
2035
+ if (arguments.length === 0) {
2036
+ return options.showClear;
2037
  }
2038
 
2039
+ if (typeof showClear !== 'boolean') {
2040
+ throw new TypeError('showClear() expects a boolean parameter');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2041
  }
2042
 
2043
+ options.showClear = showClear;
2044
+ if (widget) {
2045
+ hide();
2046
+ show();
2047
+ }
2048
+ return picker;
2049
+ };
2050
 
2051
+ picker.widgetParent = function (widgetParent) {
2052
+ if (arguments.length === 0) {
2053
+ return options.widgetParent;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2054
  }
 
2055
 
2056
+ if (typeof widgetParent === 'string') {
2057
+ widgetParent = $(widgetParent);
 
 
 
2058
  }
 
2059
 
2060
+ if (widgetParent !== null && (typeof widgetParent !== 'string' && !(widgetParent instanceof $))) {
2061
+ throw new TypeError('widgetParent() expects a string or a jQuery object parameter');
2062
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2063
 
2064
+ options.widgetParent = widgetParent;
2065
+ if (widget) {
2066
+ hide();
2067
+ show();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2068
  }
2069
+ return picker;
2070
+ };
2071
 
2072
+ picker.keepOpen = function (keepOpen) {
2073
+ if (arguments.length === 0) {
2074
+ return options.keepOpen;
2075
  }
2076
 
2077
+ if (typeof keepOpen !== 'boolean') {
2078
+ throw new TypeError('keepOpen() expects a boolean parameter');
 
2079
  }
2080
 
2081
+ options.keepOpen = keepOpen;
2082
+ return picker;
2083
+ };
2084
+
2085
+ picker.focusOnShow = function (focusOnShow) {
2086
+ if (arguments.length === 0) {
2087
+ return options.focusOnShow;
2088
  }
2089
 
2090
+ if (typeof focusOnShow !== 'boolean') {
2091
+ throw new TypeError('focusOnShow() expects a boolean parameter');
 
 
 
 
 
2092
  }
2093
 
2094
+ options.focusOnShow = focusOnShow;
2095
+ return picker;
2096
+ };
 
 
 
 
2097
 
2098
+ picker.inline = function (inline) {
2099
+ if (arguments.length === 0) {
2100
+ return options.inline;
2101
+ }
 
 
 
2102
 
2103
+ if (typeof inline !== 'boolean') {
2104
+ throw new TypeError('inline() expects a boolean parameter');
2105
+ }
2106
 
2107
+ options.inline = inline;
2108
+ return picker;
2109
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2110
 
2111
+ picker.clear = function () {
2112
+ clear();
2113
+ return picker;
2114
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2115
 
2116
+ picker.keyBinds = function (keyBinds) {
2117
+ if (arguments.length === 0) {
2118
+ return options.keyBinds;
2119
+ }
 
 
 
 
 
2120
 
2121
+ options.keyBinds = keyBinds;
2122
+ return picker;
2123
+ };
2124
 
2125
+ picker.getMoment = function (d) {
2126
+ return getMoment(d);
2127
+ };
2128
 
2129
+ picker.debug = function (debug) {
2130
+ if (typeof debug !== 'boolean') {
2131
+ throw new TypeError('debug() expects a boolean parameter');
 
 
 
 
 
2132
  }
2133
 
2134
+ options.debug = debug;
2135
+ return picker;
2136
+ };
2137
+
2138
+ picker.allowInputToggle = function (allowInputToggle) {
2139
+ if (arguments.length === 0) {
2140
+ return options.allowInputToggle;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2141
  }
2142
+
2143
+ if (typeof allowInputToggle !== 'boolean') {
2144
+ throw new TypeError('allowInputToggle() expects a boolean parameter');
2145
  }
2146
+
2147
+ options.allowInputToggle = allowInputToggle;
2148
+ return picker;
2149
+ };
2150
+
2151
+ picker.showClose = function (showClose) {
2152
+ if (arguments.length === 0) {
2153
+ return options.showClose;
2154
  }
2155
 
2156
+ if (typeof showClose !== 'boolean') {
2157
+ throw new TypeError('showClose() expects a boolean parameter');
 
 
 
 
 
2158
  }
2159
+
2160
+ options.showClose = showClose;
2161
+ return picker;
2162
+ };
2163
+
2164
+ picker.keepInvalid = function (keepInvalid) {
2165
+ if (arguments.length === 0) {
2166
+ return options.keepInvalid;
2167
  }
2168
+
2169
+ if (typeof keepInvalid !== 'boolean') {
2170
+ throw new TypeError('keepInvalid() expects a boolean parameter');
 
2171
  }
2172
+ options.keepInvalid = keepInvalid;
2173
+ return picker;
2174
+ };
2175
 
2176
+ picker.datepickerInput = function (datepickerInput) {
2177
+ if (arguments.length === 0) {
2178
+ return options.datepickerInput;
 
 
 
 
 
 
 
 
 
 
 
2179
  }
2180
+
2181
+ if (typeof datepickerInput !== 'string') {
2182
+ throw new TypeError('datepickerInput() expects a string parameter');
 
 
 
 
 
 
 
2183
  }
 
 
2184
 
2185
+ options.datepickerInput = datepickerInput;
2186
+ return picker;
2187
+ };
2188
+
2189
+ picker.parseInputDate = function (parseInputDate) {
2190
+ if (arguments.length === 0) {
2191
+ return options.parseInputDate;
 
 
 
 
 
 
 
 
2192
  }
 
 
2193
 
2194
+ if (typeof parseInputDate !== 'function') {
2195
+ throw new TypeError('parseInputDate() sholud be as function');
 
 
 
 
 
 
 
 
2196
  }
 
 
2197
 
2198
+ options.parseInputDate = parseInputDate;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2199
 
2200
+ return picker;
2201
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2202
 
2203
+ picker.disabledTimeIntervals = function (disabledTimeIntervals) {
2204
+ ///<signature helpKeyword="$.fn.datetimepicker.disabledTimeIntervals">
2205
+ ///<summary>Returns an array with the currently set disabled dates on the component.</summary>
2206
+ ///<returns type="array">options.disabledTimeIntervals</returns>
2207
+ ///</signature>
2208
+ ///<signature>
2209
+ ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of
2210
+ ///options.enabledDates if such exist.</summary>
2211
+ ///<param name="dates" locid="$.fn.datetimepicker.disabledTimeIntervals_p:dates">Takes an [ string or Date or moment ] of values and allows the user to select only from those days.</param>
2212
+ ///</signature>
2213
+ if (arguments.length === 0) {
2214
+ return (options.disabledTimeIntervals ? $.extend({}, options.disabledTimeIntervals) : options.disabledTimeIntervals);
2215
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2216
 
2217
+ if (!disabledTimeIntervals) {
2218
+ options.disabledTimeIntervals = false;
 
 
2219
  update();
2220
+ return picker;
 
 
2221
  }
2222
+ if (!(disabledTimeIntervals instanceof Array)) {
2223
+ throw new TypeError('disabledTimeIntervals() expects an array parameter');
 
 
 
2224
  }
2225
+ options.disabledTimeIntervals = disabledTimeIntervals;
2226
+ update();
2227
+ return picker;
2228
+ };
2229
 
2230
+ picker.disabledHours = function (hours) {
2231
+ ///<signature helpKeyword="$.fn.datetimepicker.disabledHours">
2232
+ ///<summary>Returns an array with the currently set disabled hours on the component.</summary>
2233
+ ///<returns type="array">options.disabledHours</returns>
2234
+ ///</signature>
2235
+ ///<signature>
2236
+ ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of
2237
+ ///options.enabledHours if such exist.</summary>
2238
+ ///<param name="hours" locid="$.fn.datetimepicker.disabledHours_p:hours">Takes an [ int ] of values and disallows the user to select only from those hours.</param>
2239
+ ///</signature>
2240
+ if (arguments.length === 0) {
2241
+ return (options.disabledHours ? $.extend({}, options.disabledHours) : options.disabledHours);
2242
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2243
 
2244
+ if (!hours) {
2245
+ options.disabledHours = false;
2246
+ update();
2247
+ return picker;
 
 
 
 
 
2248
  }
2249
+ if (!(hours instanceof Array)) {
2250
+ throw new TypeError('disabledHours() expects an array parameter');
2251
+ }
2252
+ options.disabledHours = indexGivenHours(hours);
2253
+ options.enabledHours = false;
2254
+ if (options.useCurrent && !options.keepInvalid) {
2255
+ var tries = 0;
2256
+ while (!isValid(date, 'h')) {
2257
+ date.add(1, 'h');
2258
+ if (tries === 24) {
2259
+ throw 'Tried 24 times to find a valid date';
2260
+ }
2261
+ tries++;
 
2262
  }
2263
+ setValue(date);
2264
  }
2265
+ update();
2266
+ return picker;
2267
+ };
2268
 
2269
+ picker.enabledHours = function (hours) {
2270
+ ///<signature helpKeyword="$.fn.datetimepicker.enabledHours">
2271
+ ///<summary>Returns an array with the currently set enabled hours on the component.</summary>
2272
+ ///<returns type="array">options.enabledHours</returns>
2273
+ ///</signature>
2274
+ ///<signature>
2275
+ ///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of options.disabledHours if such exist.</summary>
2276
+ ///<param name="hours" locid="$.fn.datetimepicker.enabledHours_p:hours">Takes an [ int ] of values and allows the user to select only from those hours.</param>
2277
+ ///</signature>
2278
+ if (arguments.length === 0) {
2279
+ return (options.enabledHours ? $.extend({}, options.enabledHours) : options.enabledHours);
2280
  }
 
2281
 
2282
+ if (!hours) {
2283
+ options.enabledHours = false;
2284
+ update();
2285
+ return picker;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2286
  }
2287
+ if (!(hours instanceof Array)) {
2288
+ throw new TypeError('enabledHours() expects an array parameter');
 
 
 
 
2289
  }
2290
+ options.enabledHours = indexGivenHours(hours);
2291
+ options.disabledHours = false;
2292
+ if (options.useCurrent && !options.keepInvalid) {
2293
+ var tries = 0;
2294
+ while (!isValid(date, 'h')) {
2295
+ date.add(1, 'h');
2296
+ if (tries === 24) {
2297
+ throw 'Tried 24 times to find a valid date';
 
2298
  }
2299
+ tries++;
2300
  }
2301
+ setValue(date);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2302
  }
2303
+ update();
2304
+ return picker;
2305
+ };
2306
+ /**
2307
+ * Returns the component's model current viewDate, a moment object or null if not set. Passing a null value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration.
2308
+ * @param {Takes string, viewDate, moment, null parameter.} newDate
2309
+ * @returns {viewDate.clone()}
2310
+ */
2311
+ picker.viewDate = function (newDate) {
2312
+ if (arguments.length === 0) {
2313
+ return viewDate.clone();
2314
  }
 
 
2315
 
2316
+ if (!newDate) {
2317
+ viewDate = date.clone();
2318
+ return picker;
 
 
 
 
 
 
 
 
 
2319
  }
2320
+
2321
+ if (typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) {
2322
+ throw new TypeError('viewDate() parameter must be one of [string, moment or Date]');
2323
  }
 
 
2324
 
2325
+ viewDate = parseInputDate(newDate);
2326
+ viewUpdate();
2327
+ return picker;
2328
+ };
 
2329
 
2330
+ // initializing element and component attributes
2331
+ if (element.is('input')) {
2332
+ input = element;
2333
+ } else {
2334
+ input = element.find(options.datepickerInput);
2335
+ if (input.length === 0) {
2336
+ input = element.find('input');
2337
+ } else if (!input.is('input')) {
2338
+ throw new Error('CSS class "' + options.datepickerInput + '" cannot be applied to non input element');
2339
+ }
2340
+ }
2341
+
2342
+ if (element.hasClass('input-group')) {
2343
+ // in case there is more then one 'input-group-addon' Issue #48
2344
+ if (element.find('.datepickerbutton').length === 0) {
2345
+ component = element.find('.input-group-addon');
 
 
 
 
 
 
 
 
 
 
 
 
2346
  } else {
2347
+ component = element.find('.datepickerbutton');
 
 
 
 
2348
  }
2349
+ }
2350
 
2351
+ if (!options.inline && !input.is('input')) {
2352
+ throw new Error('Could not initialize DateTimePicker without an input element');
2353
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2354
 
2355
+ // Set defaults for date here now instead of in var declaration
2356
+ date = getMoment();
2357
+ viewDate = date.clone();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2358
 
2359
+ $.extend(true, options, dataToOptions());
 
 
 
 
 
 
 
2360
 
2361
+ picker.options(options);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2362
 
2363
+ initFormatting();
 
 
2364
 
2365
+ attachDatePickerElementEvents();
 
 
2366
 
2367
+ if (input.prop('disabled')) {
2368
+ picker.disable();
2369
+ }
2370
+ if (input.is('input') && input.val().trim().length !== 0) {
2371
+ setValue(parseInputDate(input.val().trim()));
2372
+ }
2373
+ else if (options.defaultDate && input.attr('placeholder') === undefined) {
2374
+ setValue(options.defaultDate);
2375
+ }
2376
+ if (options.inline) {
2377
+ show();
2378
+ }
2379
+ return picker;
2380
+ };
2381
 
2382
+ /********************************************************************************
2383
+ *
2384
+ * jQuery plugin constructor and defaults object
2385
+ *
2386
+ ********************************************************************************/
2387
+
2388
+ /**
2389
+ * See (http://jquery.com/).
2390
+ * @name jQuery
2391
+ * @class
2392
+ * See the jQuery Library (http://jquery.com/) for full details. This just
2393
+ * documents the function and classes that are added to jQuery by this plug-in.
2394
+ */
2395
+ /**
2396
+ * See (http://jquery.com/)
2397
+ * @name fn
2398
+ * @class
2399
+ * See the jQuery Library (http://jquery.com/) for full details. This just
2400
+ * documents the function and classes that are added to jQuery by this plug-in.
2401
+ * @memberOf jQuery
2402
+ */
2403
+ /**
2404
+ * Show comments
2405
+ * @class datetimepicker
2406
+ * @memberOf jQuery.fn
2407
+ */
2408
+ $.fn.datetimepicker = function (options) {
2409
+ options = options || {};
2410
+
2411
+ var args = Array.prototype.slice.call(arguments, 1),
2412
+ isInstance = true,
2413
+ thisMethods = ['destroy', 'hide', 'show', 'toggle'],
2414
+ returnValue;
2415
+
2416
+ if (typeof options === 'object') {
2417
+ return this.each(function () {
2418
+ var $this = $(this),
2419
+ _options;
2420
+ if (!$this.data('DateTimePicker')) {
2421
+ // create a private copy of the defaults object
2422
+ _options = $.extend(true, {}, $.fn.datetimepicker.defaults, options);
2423
+ $this.data('DateTimePicker', dateTimePicker($this, _options));
2424
+ }
2425
+ });
2426
+ } else if (typeof options === 'string') {
2427
+ this.each(function () {
2428
+ var $this = $(this),
2429
+ instance = $this.data('DateTimePicker');
2430
+ if (!instance) {
2431
+ throw new Error('bootstrap-datetimepicker("' + options + '") method was called on an element that is not using DateTimePicker');
2432
+ }
2433
 
2434
+ returnValue = instance[options].apply(instance, args);
2435
+ isInstance = returnValue === instance;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2436
  });
 
 
2437
 
2438
+ if (isInstance || $.inArray(options, thisMethods) > -1) {
2439
+ return this;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2440
  }
 
2441
 
2442
+ return returnValue;
2443
+ }
 
 
2444
 
2445
+ throw new TypeError('Invalid arguments for DateTimePicker: ' + options);
2446
+ };
 
 
 
 
 
 
 
2447
 
2448
+ $.fn.datetimepicker.defaults = {
2449
+ timeZone: '',
2450
+ format: false,
2451
+ dayViewHeaderFormat: 'MMMM YYYY',
2452
+ extraFormats: false,
2453
+ stepping: 1,
2454
+ minDate: false,
2455
+ maxDate: false,
2456
+ useCurrent: true,
2457
+ collapse: true,
2458
+ locale: moment.locale(),
2459
+ defaultDate: false,
2460
+ disabledDates: false,
2461
+ enabledDates: false,
2462
+ icons: {
2463
+ time: 'glyphicon glyphicon-time',
2464
+ date: 'glyphicon glyphicon-calendar',
2465
+ up: 'glyphicon glyphicon-chevron-up',
2466
+ down: 'glyphicon glyphicon-chevron-down',
2467
+ previous: 'glyphicon glyphicon-chevron-left',
2468
+ next: 'glyphicon glyphicon-chevron-right',
2469
+ today: 'glyphicon glyphicon-screenshot',
2470
+ clear: 'glyphicon glyphicon-trash',
2471
+ close: 'glyphicon glyphicon-remove'
2472
  },
2473
+ tooltips: {
2474
+ today: 'Go to today',
2475
+ clear: 'Clear selection',
2476
+ close: 'Close the picker',
2477
+ selectMonth: 'Select Month',
2478
+ prevMonth: 'Previous Month',
2479
+ nextMonth: 'Next Month',
2480
+ selectYear: 'Select Year',
2481
+ prevYear: 'Previous Year',
2482
+ nextYear: 'Next Year',
2483
+ selectDecade: 'Select Decade',
2484
+ prevDecade: 'Previous Decade',
2485
+ nextDecade: 'Next Decade',
2486
+ prevCentury: 'Previous Century',
2487
+ nextCentury: 'Next Century',
2488
+ pickHour: 'Pick Hour',
2489
+ incrementHour: 'Increment Hour',
2490
+ decrementHour: 'Decrement Hour',
2491
+ pickMinute: 'Pick Minute',
2492
+ incrementMinute: 'Increment Minute',
2493
+ decrementMinute: 'Decrement Minute',
2494
+ pickSecond: 'Pick Second',
2495
+ incrementSecond: 'Increment Second',
2496
+ decrementSecond: 'Decrement Second',
2497
+ togglePeriod: 'Toggle Period',
2498
+ selectTime: 'Select Time'
2499
  },
2500
+ useStrict: false,
2501
+ sideBySide: false,
2502
+ daysOfWeekDisabled: false,
2503
+ calendarWeeks: false,
2504
+ viewMode: 'days',
2505
+ toolbarPlacement: 'default',
2506
+ showTodayButton: false,
2507
+ showClear: false,
2508
+ showClose: false,
2509
+ widgetPositioning: {
2510
+ horizontal: 'auto',
2511
+ vertical: 'auto'
2512
  },
2513
+ widgetParent: null,
2514
+ ignoreReadonly: false,
2515
+ keepOpen: false,
2516
+ focusOnShow: true,
2517
+ inline: false,
2518
+ keepInvalid: false,
2519
+ datepickerInput: '.datepickerinput',
2520
+ keyBinds: {
2521
+ up: function (widget) {
2522
+ if (!widget) {
2523
+ return;
2524
+ }
2525
+ var d = this.date() || this.getMoment();
2526
+ if (widget.find('.datepicker').is(':visible')) {
2527
+ this.date(d.clone().subtract(7, 'd'));
2528
+ } else {
2529
+ this.date(d.clone().add(this.stepping(), 'm'));
2530
+ }
2531
+ },
2532
+ down: function (widget) {
2533
+ if (!widget) {
2534
+ this.show();
2535
+ return;
2536
+ }
2537
+ var d = this.date() || this.getMoment();
2538
+ if (widget.find('.datepicker').is(':visible')) {
2539
+ this.date(d.clone().add(7, 'd'));
2540
+ } else {
2541
+ this.date(d.clone().subtract(this.stepping(), 'm'));
2542
+ }
2543
+ },
2544
+ 'control up': function (widget) {
2545
+ if (!widget) {
2546
+ return;
2547
+ }
2548
+ var d = this.date() || this.getMoment();
2549
+ if (widget.find('.datepicker').is(':visible')) {
2550
+ this.date(d.clone().subtract(1, 'y'));
2551
+ } else {
2552
+ this.date(d.clone().add(1, 'h'));
2553
+ }
2554
+ },
2555
+ 'control down': function (widget) {
2556
+ if (!widget) {
2557
+ return;
2558
+ }
2559
+ var d = this.date() || this.getMoment();
2560
+ if (widget.find('.datepicker').is(':visible')) {
2561
+ this.date(d.clone().add(1, 'y'));
2562
+ } else {
2563
+ this.date(d.clone().subtract(1, 'h'));
2564
+ }
2565
+ },
2566
+ left: function (widget) {
2567
+ if (!widget) {
2568
+ return;
2569
+ }
2570
+ var d = this.date() || this.getMoment();
2571
+ if (widget.find('.datepicker').is(':visible')) {
2572
+ this.date(d.clone().subtract(1, 'd'));
2573
+ }
2574
+ },
2575
+ right: function (widget) {
2576
+ if (!widget) {
2577
+ return;
2578
+ }
2579
+ var d = this.date() || this.getMoment();
2580
+ if (widget.find('.datepicker').is(':visible')) {
2581
+ this.date(d.clone().add(1, 'd'));
2582
+ }
2583
+ },
2584
+ pageUp: function (widget) {
2585
+ if (!widget) {
2586
+ return;
2587
+ }
2588
+ var d = this.date() || this.getMoment();
2589
+ if (widget.find('.datepicker').is(':visible')) {
2590
+ this.date(d.clone().subtract(1, 'M'));
2591
+ }
2592
+ },
2593
+ pageDown: function (widget) {
2594
+ if (!widget) {
2595
+ return;
2596
+ }
2597
+ var d = this.date() || this.getMoment();
2598
+ if (widget.find('.datepicker').is(':visible')) {
2599
+ this.date(d.clone().add(1, 'M'));
2600
+ }
2601
+ },
2602
+ enter: function () {
2603
+ this.hide();
2604
+ },
2605
+ escape: function () {
2606
+ this.hide();
2607
+ },
2608
+ //tab: function (widget) { //this break the flow of the form. disabling for now
2609
+ // var toggle = widget.find('.picker-switch a[data-action="togglePicker"]');
2610
+ // if(toggle.length > 0) toggle.click();
2611
+ //},
2612
+ 'control space': function (widget) {
2613
+ if (!widget) {
2614
+ return;
2615
+ }
2616
+ if (widget.find('.timepicker').is(':visible')) {
2617
+ widget.find('.btn[data-action="togglePeriod"]').click();
2618
+ }
2619
+ },
2620
+ t: function () {
2621
+ this.date(this.getMoment());
2622
+ },
2623
+ 'delete': function () {
2624
+ this.clear();
2625
+ }
2626
+ },
2627
+ debug: false,
2628
+ allowInputToggle: false,
2629
+ disabledTimeIntervals: false,
2630
+ disabledHours: false,
2631
+ enabledHours: false,
2632
+ viewDate: false
2633
  };
2634
 
2635
+ return $.fn.datetimepicker;
 
 
 
 
 
2636
  }));
assets/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /*!
2
- * Datetimepicker for Bootstrap v3
 
3
  * https://github.com/Eonasdan/bootstrap-datetimepicker/
4
- */
5
- .bootstrap-datetimepicker-widget{top:0;left:0;width:250px;padding:4px;margin-top:1px;z-index:99999!important;border-radius:4px}.bootstrap-datetimepicker-widget.timepicker-sbs{width:600px}.bootstrap-datetimepicker-widget.bottom:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);position:absolute;top:-7px;left:7px}.bootstrap-datetimepicker-widget.bottom:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:8px}.bootstrap-datetimepicker-widget.top:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,.2);position:absolute;bottom:-7px;left:6px}.bootstrap-datetimepicker-widget.top:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #fff;position:absolute;bottom:-6px;left:7px}.bootstrap-datetimepicker-widget .dow{width:14.2857%}.bootstrap-datetimepicker-widget.pull-right:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.pull-right:after{left:auto;right:7px}.bootstrap-datetimepicker-widget>ul{list-style-type:none;margin:0}.bootstrap-datetimepicker-widget .timepicker-hour,.bootstrap-datetimepicker-widget .timepicker-minute,.bootstrap-datetimepicker-widget .timepicker-second{width:100%;font-weight:bold;font-size:1.2em}.bootstrap-datetimepicker-widget table[data-hour-format="12"] .separator{width:4px;padding:0;margin:0}.bootstrap-datetimepicker-widget .datepicker>div{display:none}.bootstrap-datetimepicker-widget .picker-switch{text-align:center}.bootstrap-datetimepicker-widget table{width:100%;margin:0}.bootstrap-datetimepicker-widget td,.bootstrap-datetimepicker-widget th{text-align:center;width:20px;height:20px;border-radius:4px}.bootstrap-datetimepicker-widget td.day:hover,.bootstrap-datetimepicker-widget td.hour:hover,.bootstrap-datetimepicker-widget td.minute:hover,.bootstrap-datetimepicker-widget td.second:hover{background:#eee;cursor:pointer}.bootstrap-datetimepicker-widget td.old,.bootstrap-datetimepicker-widget td.new{color:#999}.bootstrap-datetimepicker-widget td.today{position:relative}.bootstrap-datetimepicker-widget td.today:before{content:'';display:inline-block;border-left:7px solid transparent;border-bottom:7px solid #428bca;border-top-color:rgba(0,0,0,.2);position:absolute;bottom:4px;right:4px}.bootstrap-datetimepicker-widget td.active,.bootstrap-datetimepicker-widget td.active:hover{background-color:#428bca;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.bootstrap-datetimepicker-widget td.active.today:before{border-bottom-color:#fff}.bootstrap-datetimepicker-widget td.disabled,.bootstrap-datetimepicker-widget td.disabled:hover{background:none;color:#999;cursor:not-allowed}.bootstrap-datetimepicker-widget td span{display:block;width:47px;height:54px;line-height:54px;float:left;margin:2px;cursor:pointer;border-radius:4px}.bootstrap-datetimepicker-widget td span:hover{background:#eee}.bootstrap-datetimepicker-widget td span.active{background-color:#428bca;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.bootstrap-datetimepicker-widget td span.old{color:#999}.bootstrap-datetimepicker-widget td span.disabled,.bootstrap-datetimepicker-widget td span.disabled:hover{background:none;color:#999;cursor:not-allowed}.bootstrap-datetimepicker-widget th.switch{width:145px}.bootstrap-datetimepicker-widget th.next,.bootstrap-datetimepicker-widget th.prev{font-size:21px}.bootstrap-datetimepicker-widget th.disabled,.bootstrap-datetimepicker-widget th.disabled:hover{background:none;color:#999;cursor:not-allowed}.bootstrap-datetimepicker-widget thead tr:first-child th{cursor:pointer}.bootstrap-datetimepicker-widget thead tr:first-child th:hover{background:#eee}.input-group.date .input-group-addon span{display:block;cursor:pointer;width:16px;height:16px}.bootstrap-datetimepicker-widget.left-oriented:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.left-oriented:after{left:auto;right:7px}.bootstrap-datetimepicker-widget ul.list-unstyled li div.timepicker div.timepicker-picker table.table-condensed tbody>tr>td{padding:0!important}
1
  /*!
2
+ * Datetimepicker for Bootstrap 3
3
+ * version : 4.17.47
4
  * https://github.com/Eonasdan/bootstrap-datetimepicker/
5
+ */.bootstrap-datetimepicker-widget{list-style:none}.bootstrap-datetimepicker-widget.dropdown-menu{display:block;margin:2px 0;padding:4px;width:19em}@media (min-width:768px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}@media (min-width:992px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}@media (min-width:1200px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}.bootstrap-datetimepicker-widget.dropdown-menu:before,.bootstrap-datetimepicker-widget.dropdown-menu:after{content:'';display:inline-block;position:absolute}.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,0.2);top:-7px;left:7px}.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after{border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid white;top:-6px;left:8px}.bootstrap-datetimepicker-widget.dropdown-menu.top:before{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,0.2);bottom:-7px;left:6px}.bootstrap-datetimepicker-widget.dropdown-menu.top:after{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid white;bottom:-6px;left:7px}.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after{left:auto;right:7px}.bootstrap-datetimepicker-widget .list-unstyled{margin:0}.bootstrap-datetimepicker-widget a[data-action]{padding:6px 0}.bootstrap-datetimepicker-widget a[data-action]:active{box-shadow:none}.bootstrap-datetimepicker-widget .timepicker-hour,.bootstrap-datetimepicker-widget .timepicker-minute,.bootstrap-datetimepicker-widget .timepicker-second{width:54px;font-weight:bold;font-size:1.2em;margin:0}.bootstrap-datetimepicker-widget button[data-action]{padding:6px}.bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Increment Hours"}.bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Increment Minutes"}.bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Decrement Hours"}.bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Decrement Minutes"}.bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Show Hours"}.bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Show Minutes"}.bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Toggle AM/PM"}.bootstrap-datetimepicker-widget .btn[data-action="clear"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Clear the picker"}.bootstrap-datetimepicker-widget .btn[data-action="today"]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Set the date to today"}.bootstrap-datetimepicker-widget .picker-switch{text-align:center}.bootstrap-datetimepicker-widget .picker-switch::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Toggle Date and Time Screens"}.bootstrap-datetimepicker-widget .picker-switch td{padding:0;margin:0;height:auto;width:auto;line-height:inherit}.bootstrap-datetimepicker-widget .picker-switch td span{line-height:2.5;height:2.5em;width:100%}.bootstrap-datetimepicker-widget table{width:100%;margin:0}.bootstrap-datetimepicker-widget table td,.bootstrap-datetimepicker-widget table th{text-align:center;border-radius:4px}.bootstrap-datetimepicker-widget table th{height:20px;line-height:20px;width:20px}.bootstrap-datetimepicker-widget table th.picker-switch{width:145px}.bootstrap-datetimepicker-widget table th.disabled,.bootstrap-datetimepicker-widget table th.disabled:hover{background:none;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget table th.prev::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Previous Month"}.bootstrap-datetimepicker-widget table th.next::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;content:"Next Month"}.bootstrap-datetimepicker-widget table thead tr:first-child th{cursor:pointer}.bootstrap-datetimepicker-widget table thead tr:first-child th:hover{background:#eee}.bootstrap-datetimepicker-widget table td{height:54px;line-height:54px;width:54px}.bootstrap-datetimepicker-widget table td.cw{font-size:.8em;height:20px;line-height:20px;color:#777}.bootstrap-datetimepicker-widget table td.day{height:20px;line-height:20px;width:20px}.bootstrap-datetimepicker-widget table td.day:hover,.bootstrap-datetimepicker-widget table td.hour:hover,.bootstrap-datetimepicker-widget table td.minute:hover,.bootstrap-datetimepicker-widget table td.second:hover{background:#eee;cursor:pointer}.bootstrap-datetimepicker-widget table td.old,.bootstrap-datetimepicker-widget table td.new{color:#777}.bootstrap-datetimepicker-widget table td.today{position:relative}.bootstrap-datetimepicker-widget table td.today:before{content:'';display:inline-block;border:solid transparent;border-width:0 0 7px 7px;border-bottom-color:#337ab7;border-top-color:rgba(0,0,0,0.2);position:absolute;bottom:4px;right:4px}.bootstrap-datetimepicker-widget table td.active,.bootstrap-datetimepicker-widget table td.active:hover{background-color:#337ab7;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.bootstrap-datetimepicker-widget table td.active.today:before{border-bottom-color:#fff}.bootstrap-datetimepicker-widget table td.disabled,.bootstrap-datetimepicker-widget table td.disabled:hover{background:none;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget table td span{display:inline-block;width:54px;height:54px;line-height:54px;margin:2px 1.5px;cursor:pointer;border-radius:4px}.bootstrap-datetimepicker-widget table td span:hover{background:#eee}.bootstrap-datetimepicker-widget table td span.active{background-color:#337ab7;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.bootstrap-datetimepicker-widget table td span.old{color:#777}.bootstrap-datetimepicker-widget table td span.disabled,.bootstrap-datetimepicker-widget table td span.disabled:hover{background:none;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget.usetwentyfour td.hour{height:27px;line-height:27px}.bootstrap-datetimepicker-widget.wider{width:21em}.bootstrap-datetimepicker-widget .datepicker-decades .decade{line-height:1.8em !important}.input-group.date .input-group-addon{cursor:pointer}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}
 
assets/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js CHANGED
@@ -1,29 +1,2 @@
1
- /*
2
- Version 3.0.0
3
- =========================================================
4
- bootstrap-datetimepicker.js
5
- https://github.com/Eonasdan/bootstrap-datetimepicker
6
- =========================================================
7
- The MIT License (MIT)
8
-
9
- Copyright (c) 2014 Jonathan Peterson
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in
19
- all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
- THE SOFTWARE.
28
- */
29
- (function(n){if(typeof define=="function"&&define.amd)define(["jquery","moment"],n);else if(jQuery)if(moment)n(jQuery,moment);else throw"bootstrap-datetimepicker requires moment.js to be loaded first";else throw"bootstrap-datetimepicker requires jQuery to be loaded first";})(function(n,t){if(typeof t=="undefined"){alert("momentjs is requried");throw new Error("momentjs is required");}var u=0,r=t,f=function(t,f){var st={pickDate:!0,pickTime:!0,useMinutes:!0,useSeconds:!1,useCurrent:!0,minuteStepping:1,minDate:new r({y:1900}),maxDate:(new r).add(100,"y"),showToday:!0,collapse:!0,language:"en",defaultDate:"",disabledDates:!1,enabledDates:!1,icons:{},useStrict:!1,direction:"auto",sideBySide:!1,daysOfWeekDisabled:!1},ht={time:"glyphicon glyphicon-time",date:"glyphicon glyphicon-calendar",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down"},e=this,ct=function(){var i=!1,o,h,s;if(e.options=n.extend({},st,f),e.options.icons=n.extend({},ht,e.options.icons),e.element=n(t),lt(),!(e.options.pickTime||e.options.pickDate))throw new Error("Must choose at least one picker");if(e.id=u++,r.lang(e.options.language),e.date=r(),e.unset=!1,e.isInput=e.element.is("input"),e.component=!1,e.element.hasClass("input-group")&&(e.component=e.element.find(".datepickerbutton").size()==0?e.element.find("[class^='input-group-']"):e.element.find(".datepickerbutton")),e.format=e.options.format,o=r()._lang._longDateFormat,e.format||(e.format=e.options.pickDate?o.L:"",e.options.pickDate&&e.options.pickTime&&(e.format+=" "),e.format+=e.options.pickTime?o.LT:"",e.options.useSeconds&&(~o.LT.indexOf(" A")?e.format=e.format.split(" A")[0]+":ss A":e.format+=":ss")),e.use24hours=e.format.toLowerCase().indexOf("a")<1,e.component&&(i=e.component.find("span")),e.options.pickTime&&i&&i.addClass(e.options.icons.time),e.options.pickDate&&i&&(i.removeClass(e.options.icons.time),i.addClass(e.options.icons.date)),e.widget=n(ni()).appendTo("body"),e.options.useSeconds&&!e.use24hours&&e.widget.width(300),e.minViewMode=e.options.minViewMode||0,typeof e.minViewMode=="string")switch(e.minViewMode){case"months":e.minViewMode=1;break;case"years":e.minViewMode=2;break;default:e.minViewMode=0}if(e.viewMode=e.options.viewMode||0,typeof e.viewMode=="string")switch(e.viewMode){case"months":e.viewMode=1;break;case"years":e.viewMode=2;break;default:e.viewMode=0}e.options.disabledDates=d(e.options.disabledDates);e.options.enabledDates=d(e.options.enabledDates);e.startViewMode=e.viewMode;e.setMinDate(e.options.minDate);e.setMaxDate(e.options.maxDate);at();vt();yt();pt();wt();l();b();ut();e.options.defaultDate!==""&&p().val()==""&&e.setValue(e.options.defaultDate);e.options.minuteStepping!==1&&(h=e.date.minutes(),s=e.options.minuteStepping,e.date.minutes(Math.round(h/s)*s%60).seconds(0))},p=function(){return e.isInput?e.element:dateStr=e.element.find("input")},lt=function(){var n;n=e.element.is("input")?e.element.data():e.element.data();n.dateFormat!==undefined&&(e.options.format=n.dateFormat);n.datePickdate!==undefined&&(e.options.pickDate=n.datePickdate);n.datePicktime!==undefined&&(e.options.pickTime=n.datePicktime);n.dateUseminutes!==undefined&&(e.options.useMinutes=n.dateUseminutes);n.dateUseseconds!==undefined&&(e.options.useSeconds=n.dateUseseconds);n.dateUsecurrent!==undefined&&(e.options.useCurrent=n.dateUsecurrent);n.dateMinutestepping!==undefined&&(e.options.minuteStepping=n.dateMinutestepping);n.dateMindate!==undefined&&(e.options.minDate=n.dateMindate);n.dateMaxdate!==undefined&&(e.options.maxDate=n.dateMaxdate);n.dateShowtoday!==undefined&&(e.options.showToday=n.dateShowtoday);n.dateCollapse!==undefined&&(e.options.collapse=n.dateCollapse);n.dateLanguage!==undefined&&(e.options.language=n.dateLanguage);n.dateDefaultdate!==undefined&&(e.options.defaultDate=n.dateDefaultdate);n.dateDisableddates!==undefined&&(e.options.disabledDates=n.dateDisableddates);n.dateEnableddates!==undefined&&(e.options.enabledDates=n.dateEnableddates);n.dateIcons!==undefined&&(e.options.icons=n.dateIcons);n.dateUsestrict!==undefined&&(e.options.useStrict=n.dateUsestrict);n.dateDirection!==undefined&&(e.options.direction=n.dateDirection);n.dateSidebyside!==undefined&&(e.options.sideBySide=n.dateSidebyside)},it=function(){var u="absolute",t=e.component?e.component.offset():e.element.offset(),i=n(window),r;e.width=e.component?e.component.outerWidth():e.element.outerWidth();t.top=t.top+e.element.outerHeight();e.options.direction==="up"?r="top":e.options.direction==="bottom"?r="bottom":e.options.direction==="auto"&&(r=t.top+e.widget.height()>i.height()+i.scrollTop()&&e.widget.height()+e.element.outerHeight()<t.top?"top":"bottom");r==="top"?(t.top-=e.widget.height()+e.element.outerHeight()+15,e.widget.addClass("top").removeClass("bottom")):(t.top+=1,e.widget.addClass("bottom").removeClass("top"));e.options.width!==undefined&&e.widget.width(e.options.width);e.options.orientation==="left"&&(e.widget.addClass("left-oriented"),t.left=t.left-e.widget.width()+20);gt()&&(u="fixed",t.top-=i.scrollTop(),t.left-=i.scrollLeft());i.width()<t.left+e.widget.outerWidth()?(t.right=i.width()-t.left-e.width,t.left="auto",e.widget.addClass("pull-right")):(t.right="auto",e.widget.removeClass("pull-right"));e.widget.css({position:u,top:t.top,left:t.left,right:t.right})},c=function(n,t){r(e.date).isSame(r(n))||(e.element.trigger({type:"dp.change",date:r(e.date),oldDate:r(n)}),t!=="change"&&e.element.change())},g=function(n){e.element.trigger({type:"dp.error",date:r(n)})},l=function(n){r.lang(e.options.language);var t=n;t||(t=p().val(),t&&(e.date=r(t,e.format,e.options.useStrict)),e.date||(e.date=r()));e.viewDate=r(e.date).startOf("month");y();nt()},at=function(){r.lang(e.options.language);var i=n("<tr>"),u=r.weekdaysMin(),t;if(r()._lang._week.dow==0)for(t=0;t<7;t++)i.append('<th class="dow">'+u[t]+"<\/th>");else for(t=1;t<8;t++)t==7?i.append('<th class="dow">'+u[0]+"<\/th>"):i.append('<th class="dow">'+u[t]+"<\/th>");e.widget.find(".datepicker-days thead").append(i)},vt=function(){r.lang(e.options.language);for(var n="",t=0,i=r.monthsShort();t<12;)n+='<span class="month">'+i[t++]+"<\/span>";e.widget.find(".datepicker-months td").append(n)},y=function(){r.lang(e.options.language);var t=e.viewDate.year(),h=e.viewDate.month(),o=e.options.minDate.year(),y=e.options.minDate.month(),s=e.options.maxDate.year(),p=e.options.maxDate.month(),i,w,c=[],v,f,u,b,d,l,a=r.months();for(e.widget.find(".datepicker-days").find(".disabled").removeClass("disabled"),e.widget.find(".datepicker-months").find(".disabled").removeClass("disabled"),e.widget.find(".datepicker-years").find(".disabled").removeClass("disabled"),e.widget.find(".datepicker-days th:eq(1)").text(a[h]+" "+t),i=r(e.viewDate).subtract("months",1),b=i.daysInMonth(),i.date(b).startOf("week"),(t==o&&h<=y||t<o)&&e.widget.find(".datepicker-days th:eq(0)").addClass("disabled"),(t==s&&h>=p||t>s)&&e.widget.find(".datepicker-days th:eq(2)").addClass("disabled"),w=r(i).add(42,"d");i.isBefore(w);){if(i.weekday()===r().startOf("week").weekday()&&(v=n("<tr>"),c.push(v)),f="",i.year()<t||i.year()==t&&i.month()<h?f+=" old":(i.year()>t||i.year()==t&&i.month()>h)&&(f+=" new"),i.isSame(r({y:e.date.year(),M:e.date.month(),d:e.date.date()}))&&(f+=" active"),(k(i)||!ot(i))&&(f+=" disabled"),e.options.showToday===!0&&i.isSame(r(),"day")&&(f+=" today"),e.options.daysOfWeekDisabled)for(u in e.options.daysOfWeekDisabled)if(i.day()==e.options.daysOfWeekDisabled[u]){f+=" disabled";break}v.append('<td class="day'+f+'">'+i.date()+"<\/td>");i.add(1,"d")}for(e.widget.find(".datepicker-days tbody").empty().append(c),l=e.date.year(),a=e.widget.find(".datepicker-months").find("th:eq(1)").text(t).end().find("span").removeClass("active"),l===t&&a.eq(e.date.month()).addClass("active"),l-1<o&&e.widget.find(".datepicker-months th:eq(0)").addClass("disabled"),l+1>s&&e.widget.find(".datepicker-months th:eq(2)").addClass("disabled"),u=0;u<12;u++)t==o&&y>u||t<o?n(a[u]).addClass("disabled"):(t==s&&p<u||t>s)&&n(a[u]).addClass("disabled");for(c="",t=parseInt(t/10,10)*10,d=e.widget.find(".datepicker-years").find("th:eq(1)").text(t+"-"+(t+9)).end().find("td"),e.widget.find(".datepicker-years").find("th").removeClass("disabled"),o>t&&e.widget.find(".datepicker-years").find("th:eq(0)").addClass("disabled"),s<t+9&&e.widget.find(".datepicker-years").find("th:eq(2)").addClass("disabled"),t-=1,u=-1;u<11;u++)c+='<span class="year'+(u===-1||u===10?" old":"")+(l===t?" active":"")+(t<o||t>s?" disabled":"")+'">'+t+"<\/span>",t+=1;d.html(c)},yt=function(){r.lang(e.options.language);var f=e.widget.find(".timepicker .timepicker-hours table"),n="",t,i,u;if(f.parent().hide(),e.use24hours)for(t=0,i=0;i<6;i+=1){for(n+="<tr>",u=0;u<4;u+=1)n+='<td class="hour">'+s(t.toString())+"<\/td>",t++;n+="<\/tr>"}else for(t=1,i=0;i<3;i+=1){for(n+="<tr>",u=0;u<4;u+=1)n+='<td class="hour">'+s(t.toString())+"<\/td>",t++;n+="<\/tr>"}f.html(n)},pt=function(){var f=e.widget.find(".timepicker .timepicker-minutes table"),n="",i=0,r,u,t=e.options.minuteStepping;for(f.parent().hide(),(t=1)&&(t=5),r=0;r<Math.ceil(15/t);r++){for(n+="<tr>",u=0;u<4;u+=1)i<60?(n+='<td class="minute">'+s(i.toString())+"<\/td>",i+=t):n+="<td><\/td>";n+="<\/tr>"}f.html(n)},wt=function(){var r=e.widget.find(".timepicker .timepicker-seconds table"),n="",u=0,t,i;for(r.parent().hide(),t=0;t<3;t++){for(n+="<tr>",i=0;i<4;i+=1)n+='<td class="second">'+s(u.toString())+"<\/td>",u+=5;n+="<\/tr>"}r.html(n)},nt=function(){if(e.date){var t=e.widget.find(".timepicker span[data-time-component]"),n=e.date.hours(),i="AM";e.use24hours||(n>=12&&(i="PM"),n===0?n=12:n!=12&&(n=n%12),e.widget.find(".timepicker [data-action=togglePeriod]").text(i));t.filter("[data-time-component=hours]").text(s(n));t.filter("[data-time-component=minutes]").text(s(e.date.minutes()));t.filter("[data-time-component=seconds]").text(s(e.date.second()))}},bt=function(t){t.stopPropagation();t.preventDefault();e.unset=!1;var i=n(t.target).closest("span, td, th"),u,f,s,h,l=r(e.date);if(i.length===1&&!i.is(".disabled"))switch(i[0].nodeName.toLowerCase()){case"th":switch(i[0].className){case"switch":b(1);break;case"prev":case"next":s=o.modes[e.viewMode].navStep;i[0].className==="prev"&&(s=s*-1);e.viewDate.add(s,o.modes[e.viewMode].navFnc);y()}break;case"span":i.is(".month")?(u=i.parent().find("span").index(i),e.viewDate.month(u)):(f=parseInt(i.text(),10)||0,e.viewDate.year(f));e.viewMode===e.minViewMode&&(e.date=r({y:e.viewDate.year(),M:e.viewDate.month(),d:e.viewDate.date(),h:e.date.hours(),m:e.date.minutes(),s:e.date.seconds()}),c(l,t.type),a());b(-1);y();break;case"td":i.is(".day")&&(h=parseInt(i.text(),10)||1,u=e.viewDate.month(),f=e.viewDate.year(),i.is(".old")?u===0?(u=11,f-=1):u-=1:i.is(".new")&&(u==11?(u=0,f+=1):u+=1),e.date=r({y:f,M:u,d:h,h:e.date.hours(),m:e.date.minutes(),s:e.date.seconds()}),e.viewDate=r({y:f,M:u,d:Math.min(28,h)}),y(),a(),c(l,t.type))}},w={incrementHours:function(){v("add","hours",1)},incrementMinutes:function(){v("add","minutes",e.options.minuteStepping)},incrementSeconds:function(){v("add","seconds",1)},decrementHours:function(){v("subtract","hours",1)},decrementMinutes:function(){v("subtract","minutes",e.options.minuteStepping)},decrementSeconds:function(){v("subtract","seconds",1)},togglePeriod:function(){var n=e.date.hours();n>=12?n-=12:n+=12;e.date.hours(n)},showPicker:function(){e.widget.find(".timepicker > div:not(.timepicker-picker)").hide();e.widget.find(".timepicker .timepicker-picker").show()},showHours:function(){e.widget.find(".timepicker .timepicker-picker").hide();e.widget.find(".timepicker .timepicker-hours").show()},showMinutes:function(){e.widget.find(".timepicker .timepicker-picker").hide();e.widget.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){e.widget.find(".timepicker .timepicker-picker").hide();e.widget.find(".timepicker .timepicker-seconds").show()},selectHour:function(t){var r=e.widget.find(".timepicker [data-action=togglePeriod]").text(),i=parseInt(n(t.target).text(),10);r=="PM"&&(i+=12);e.date.hours(i);w.showPicker.call(e)},selectMinute:function(t){e.date.minutes(parseInt(n(t.target).text(),10));w.showPicker.call(e)},selectSecond:function(t){e.date.seconds(parseInt(n(t.target).text(),10));w.showPicker.call(e)}},kt=function(t){var i=r(e.date),u=n(t.currentTarget).data("action"),f=w[u].apply(e,arguments);return tt(t),e.date||(e.date=r({y:1970})),a(),nt(),c(i,t.type),f},tt=function(n){n.stopPropagation();n.preventDefault()},rt=function(t){r.lang(e.options.language);var f=n(t.target),u=r(e.date),i=r(f.val(),e.format,e.options.useStrict);i.isValid()&&!k(i)&&ot(i)?(l(),e.setValue(i),c(u,t.type),a()):(e.viewDate=u,c(u,t.type),g(i),e.unset=!0)},b=function(n){n&&(e.viewMode=Math.max(e.minViewMode,Math.min(2,e.viewMode+n)));var t=o.modes[e.viewMode].clsName;e.widget.find(".datepicker > div").hide().filter(".datepicker-"+o.modes[e.viewMode].clsName).show()},ut=function(){var i,r,t,f,u;e.widget.on("click",".datepicker *",n.proxy(bt,this));e.widget.on("click","[data-action]",n.proxy(kt,this));e.widget.on("mousedown",n.proxy(tt,this));if(e.options.pickDate&&e.options.pickTime)e.widget.on("click.togglePicker",".accordion-toggle",function(o){if(o.stopPropagation(),i=n(this),r=i.closest("ul"),t=r.find(".in"),f=r.find(".collapse:not(.in)"),t&&t.length){if(u=t.data("collapse"),u&&u.date-transitioning)return;t.collapse("hide");f.collapse("show");i.find("span").toggleClass(e.options.icons.time+" "+e.options.icons.date);e.element.find(".input-group-addon span").toggleClass(e.options.icons.time+" "+e.options.icons.date)}});if(e.isInput)e.element.on({focus:n.proxy(e.show,this),change:n.proxy(rt,this),blur:n.proxy(e.hide,this)});else{e.element.on({change:n.proxy(rt,this)},"input");if(e.component)e.component.on("click",n.proxy(e.show,this));else e.element.on("click",n.proxy(e.show,this))}},dt=function(){n(window).on("resize.datetimepicker"+e.id,n.proxy(it,this));if(!e.isInput)n(document).on("mousedown.datetimepicker"+e.id,n.proxy(e.hide,this))},ft=function(){e.widget.off("click",".datepicker *",e.click);e.widget.off("click","[data-action]");e.widget.off("mousedown",e.stopEvent);e.options.pickDate&&e.options.pickTime&&e.widget.off("click.togglePicker");e.isInput?e.element.off({focus:e.show,change:e.change}):(e.element.off({change:e.change},"input"),e.component?e.component.off("click",e.show):e.element.off("click",e.show))},et=function(){n(window).off("resize.datetimepicker"+e.id);e.isInput||n(document).off("mousedown.datetimepicker"+e.id)},gt=function(){if(e.element){for(var i=e.element.parents(),r=!1,t=0;t<i.length;t++)if(n(i[t]).css("position")=="fixed"){r=!0;break}return r}return!1},a=function(){r.lang(e.options.language);var n="";e.unset||(n=r(e.date).format(e.format));p().val(n);e.element.data("date",n);e.options.pickTime||e.hide()},v=function(n,t,i){r.lang(e.options.language);var u;if(n=="add"?(u=r(e.date),u.hours()==23&&u.add(i,t),u.add(i,t)):u=r(e.date).subtract(i,t),k(r(u.subtract(i,t)))||k(u)){g(u.format(e.format));return}n=="add"?e.date.add(i,t):e.date.subtract(i,t);e.unset=!1},k=function(n){return(r.lang(e.options.language),n.isAfter(e.options.maxDate)||n.isBefore(e.options.minDate))?!0:e.options.disabledDates===!1?!1:e.options.disabledDates[r(n).format("YYYY-MM-DD")]===!0},ot=function(n){return(r.lang(e.options.language),e.options.enabledDates===!1)?!0:e.options.enabledDates[r(n).format("YYYY-MM-DD")]===!0},d=function(n){var t={},u=0;for(i=0;i<n.length;i++)dDate=r(n[i]),dDate.isValid()&&(t[dDate.format("YYYY-MM-DD")]=!0,u++);return u>0?t:!1},s=function(n){return n=n.toString(),n.length>=2?n:"0"+n},ni=function(){if(e.options.pickDate&&e.options.pickTime){var n="";return n='<div class="bootstrap-datetimepicker-widget'+(e.options.sideBySide?" timepicker-sbs":"")+' dropdown-menu" style="z-index:9999 !important;">',n+=e.options.sideBySide?'<div class="row"><div class="col-sm-6 datepicker">'+o.template+'<\/div><div class="col-sm-6 timepicker">'+h.getTemplate()+"<\/div><\/div>":'<ul class="list-unstyled"><li'+(e.options.collapse?' class="collapse in"':"")+'><div class="datepicker">'+o.template+'<\/div><\/li><li class="picker-switch accordion-toggle"><a class="btn" style="width:100%"><span class="'+e.options.icons.time+'"><\/span><\/a><\/li><li'+(e.options.collapse?' class="collapse"':"")+'><div class="timepicker">'+h.getTemplate()+"<\/div><\/li><\/ul>",n+"<\/div>"}return e.options.pickTime?'<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="timepicker">'+h.getTemplate()+"<\/div><\/div>":'<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="datepicker">'+o.template+"<\/div><\/div>"},o={modes:[{clsName:"days",navFnc:"month",navStep:1},{clsName:"months",navFnc:"year",navStep:1},{clsName:"years",navFnc:"year",navStep:10}],headTemplate:'<thead><tr><th class="prev">&lsaquo;<\/th><th colspan="5" class="switch"><\/th><th class="next">&rsaquo;<\/th><\/tr><\/thead>',contTemplate:'<tbody><tr><td colspan="7"><\/td><\/tr><\/tbody>'},h={hourTemplate:'<span data-action="showHours" data-time-component="hours" class="timepicker-hour"><\/span>',minuteTemplate:'<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"><\/span>',secondTemplate:'<span data-action="showSeconds" data-time-component="seconds" class="timepicker-second"><\/span>'};o.template='<div class="datepicker-days"><table class="table-condensed">'+o.headTemplate+'<tbody><\/tbody><\/table><\/div><div class="datepicker-months"><table class="table-condensed">'+o.headTemplate+o.contTemplate+'<\/table><\/div><div class="datepicker-years"><table class="table-condensed">'+o.headTemplate+o.contTemplate+"<\/table><\/div>";h.getTemplate=function(){return'<div class="timepicker-picker"><table class="table-condensed"><tr><td><a href="#" class="btn" data-action="incrementHours"><span class="'+e.options.icons.up+'"><\/span><\/a><\/td><td class="separator"><\/td><td>'+(e.options.useMinutes?'<a href="#" class="btn" data-action="incrementMinutes"><span class="'+e.options.icons.up+'"><\/span><\/a>':"")+"<\/td>"+(e.options.useSeconds?'<td class="separator"><\/td><td><a href="#" class="btn" data-action="incrementSeconds"><span class="'+e.options.icons.up+'"><\/span><\/a><\/td>':"")+(e.use24hours?"":'<td class="separator"><\/td>')+"<\/tr><tr><td>"+h.hourTemplate+'<\/td> <td class="separator">:<\/td><td>'+(e.options.useMinutes?h.minuteTemplate:'<span class="timepicker-minute">00<\/span>')+"<\/td> "+(e.options.useSeconds?'<td class="separator">:<\/td><td>'+h.secondTemplate+"<\/td>":"")+(e.use24hours?"":'<td class="separator"><\/td><td><button type="button" class="btn btn-primary" data-action="togglePeriod"><\/button><\/td>')+'<\/tr><tr><td><a href="#" class="btn" data-action="decrementHours"><span class="'+e.options.icons.down+'"><\/span><\/a><\/td><td class="separator"><\/td><td>'+(e.options.useMinutes?'<a href="#" class="btn" data-action="decrementMinutes"><span class="'+e.options.icons.down+'"><\/span><\/a>':"")+"<\/td>"+(e.options.useSeconds?'<td class="separator"><\/td><td><a href="#" class="btn" data-action="decrementSeconds"><span class="'+e.options.icons.down+'"><\/span><\/a><\/td>':"")+(e.use24hours?"":'<td class="separator"><\/td>')+'<\/tr><\/table><\/div><div class="timepicker-hours" data-action="selectHour"><table class="table-condensed"><\/table><\/div><div class="timepicker-minutes" data-action="selectMinute"><table class="table-condensed"><\/table><\/div>'+(e.options.useSeconds?'<div class="timepicker-seconds" data-action="selectSecond"><table class="table-condensed"><\/table><\/div>':"")};e.destroy=function(){ft();et();e.widget.remove();e.element.removeData("DateTimePicker");e.component&&e.component.removeData("DateTimePicker")};e.show=function(n){e.options.useCurrent===!0&&p().val()==""&&e.setValue(r().format(e.format));e.widget.show();e.height=e.component?e.component.outerHeight():e.element.outerHeight();it();e.element.trigger({type:"dp.show",date:r(e.date)});dt();n&&tt(n)};e.disable=function(){var n=e.element.find("input");n.prop("disabled")||(n.prop("disabled",!0),ft())};e.enable=function(){var n=e.element.find("input");n.prop("disabled")&&(n.prop("disabled",!1),ut())};e.hide=function(t){if(!t||!n(t.target).is(e.element.attr("id"))){for(var f=e.widget.find(".collapse"),u,i=0;i<f.length;i++)if(u=f.eq(i).data("collapse"),u&&u.date-transitioning)return;e.widget.hide();e.viewMode=e.startViewMode;b();e.element.trigger({type:"dp.hide",date:r(e.date)});et()}};e.setValue=function(n){r.lang(e.options.language);n?e.unset=!1:(e.unset=!0,a());r.isMoment(n)||(n=r(n));n.isValid()?(e.date=n,a(),e.viewDate=r({y:e.date.year(),M:e.date.month()}),y(),nt()):g(n)};e.getDate=function(){return e.unset?null:e.date};e.setDate=function(n){var t=r(e.date);n?e.setValue(n):e.setValue(null);c(t,"function")};e.setDisabledDates=function(n){e.options.disabledDates=d(n);e.viewDate&&l()};e.setEnabledDates=function(n){e.options.enabledDates=d(n);e.viewDate&&l()};e.setMaxDate=function(n){n!=undefined&&(e.options.maxDate=r(n),e.viewDate&&l())};e.setMinDate=function(n){n!=undefined&&(e.options.minDate=r(n),e.viewDate&&l())};ct()};n.fn.datetimepicker=function(t){return this.each(function(){var i=n(this),r=i.data("DateTimePicker");r||i.data("DateTimePicker",new f(this,t))})}});
1
+ !function(a){"use strict";if("function"==typeof define&&define.amd)define(["jquery","moment"],a);else if("object"==typeof exports)module.exports=a(require("jquery"),require("moment"));else{if("undefined"==typeof jQuery)throw"bootstrap-datetimepicker requires jQuery to be loaded first";if("undefined"==typeof moment)throw"bootstrap-datetimepicker requires Moment.js to be loaded first";a(jQuery,moment)}}(function(a,b){"use strict";if(!b)throw new Error("bootstrap-datetimepicker requires Moment.js to be loaded first");var c=function(c,d){var e,f,g,h,i,j,k,l={},m=!0,n=!1,o=!1,p=0,q=[{clsName:"days",navFnc:"M",navStep:1},{clsName:"months",navFnc:"y",navStep:1},{clsName:"years",navFnc:"y",navStep:10},{clsName:"decades",navFnc:"y",navStep:100}],r=["days","months","years","decades"],s=["top","bottom","auto"],t=["left","right","auto"],u=["default","top","bottom"],v={up:38,38:"up",down:40,40:"down",left:37,37:"left",right:39,39:"right",tab:9,9:"tab",escape:27,27:"escape",enter:13,13:"enter",pageUp:33,33:"pageUp",pageDown:34,34:"pageDown",shift:16,16:"shift",control:17,17:"control",space:32,32:"space",t:84,84:"t",delete:46,46:"delete"},w={},x=function(){return void 0!==b.tz&&void 0!==d.timeZone&&null!==d.timeZone&&""!==d.timeZone},y=function(a){var c;return c=void 0===a||null===a?b():b.isDate(a)||b.isMoment(a)?b(a):x()?b.tz(a,j,d.useStrict,d.timeZone):b(a,j,d.useStrict),x()&&c.tz(d.timeZone),c},z=function(a){if("string"!=typeof a||a.length>1)throw new TypeError("isEnabled expects a single character string parameter");switch(a){case"y":return i.indexOf("Y")!==-1;case"M":return i.indexOf("M")!==-1;case"d":return i.toLowerCase().indexOf("d")!==-1;case"h":case"H":return i.toLowerCase().indexOf("h")!==-1;case"m":return i.indexOf("m")!==-1;case"s":return i.indexOf("s")!==-1;default:return!1}},A=function(){return z("h")||z("m")||z("s")},B=function(){return z("y")||z("M")||z("d")},C=function(){var b=a("<thead>").append(a("<tr>").append(a("<th>").addClass("prev").attr("data-action","previous").append(a("<span>").addClass(d.icons.previous))).append(a("<th>").addClass("picker-switch").attr("data-action","pickerSwitch").attr("colspan",d.calendarWeeks?"6":"5")).append(a("<th>").addClass("next").attr("data-action","next").append(a("<span>").addClass(d.icons.next)))),c=a("<tbody>").append(a("<tr>").append(a("<td>").attr("colspan",d.calendarWeeks?"8":"7")));return[a("<div>").addClass("datepicker-days").append(a("<table>").addClass("table-condensed").append(b).append(a("<tbody>"))),a("<div>").addClass("datepicker-months").append(a("<table>").addClass("table-condensed").append(b.clone()).append(c.clone())),a("<div>").addClass("datepicker-years").append(a("<table>").addClass("table-condensed").append(b.clone()).append(c.clone())),a("<div>").addClass("datepicker-decades").append(a("<table>").addClass("table-condensed").append(b.clone()).append(c.clone()))]},D=function(){var b=a("<tr>"),c=a("<tr>"),e=a("<tr>");return z("h")&&(b.append(a("<td>").append(a("<a>").attr({href:"#",tabindex:"-1",title:d.tooltips.incrementHour}).addClass("btn").attr("data-action","incrementHours").append(a("<span>").addClass(d.icons.up)))),c.append(a("<td>").append(a("<span>").addClass("timepicker-hour").attr({"data-time-component":"hours",title:d.tooltips.pickHour}).attr("data-action","showHours"))),e.append(a("<td>").append(a("<a>").attr({href:"#",tabindex:"-1",title:d.tooltips.decrementHour}).addClass("btn").attr("data-action","decrementHours").append(a("<span>").addClass(d.icons.down))))),z("m")&&(z("h")&&(b.append(a("<td>").addClass("separator")),c.append(a("<td>").addClass("separator").html(":")),e.append(a("<td>").addClass("separator"))),b.append(a("<td>").append(a("<a>").attr({href:"#",tabindex:"-1",title:d.tooltips.incrementMinute}).addClass("btn").attr("data-action","incrementMinutes").append(a("<span>").addClass(d.icons.up)))),c.append(a("<td>").append(a("<span>").addClass("timepicker-minute").attr({"data-time-component":"minutes",title:d.tooltips.pickMinute}).attr("data-action","showMinutes"))),e.append(a("<td>").append(a("<a>").attr({href:"#",tabindex:"-1",title:d.tooltips.decrementMinute}).addClass("btn").attr("data-action","decrementMinutes").append(a("<span>").addClass(d.icons.down))))),z("s")&&(z("m")&&(b.append(a("<td>").addClass("separator")),c.append(a("<td>").addClass("separator").html(":")),e.append(a("<td>").addClass("separator"))),b.append(a("<td>").append(a("<a>").attr({href:"#",tabindex:"-1",title:d.tooltips.incrementSecond}).addClass("btn").attr("data-action","incrementSeconds").append(a("<span>").addClass(d.icons.up)))),c.append(a("<td>").append(a("<span>").addClass("timepicker-second").attr({"data-time-component":"seconds",title:d.tooltips.pickSecond}).attr("data-action","showSeconds"))),e.append(a("<td>").append(a("<a>").attr({href:"#",tabindex:"-1",title:d.tooltips.decrementSecond}).addClass("btn").attr("data-action","decrementSeconds").append(a("<span>").addClass(d.icons.down))))),h||(b.append(a("<td>").addClass("separator")),c.append(a("<td>").append(a("<button>").addClass("btn btn-primary").attr({"data-action":"togglePeriod",tabindex:"-1",title:d.tooltips.togglePeriod}))),e.append(a("<td>").addClass("separator"))),a("<div>").addClass("timepicker-picker").append(a("<table>").addClass("table-condensed").append([b,c,e]))},E=function(){var b=a("<div>").addClass("timepicker-hours").append(a("<table>").addClass("table-condensed")),c=a("<div>").addClass("timepicker-minutes").append(a("<table>").addClass("table-condensed")),d=a("<div>").addClass("timepicker-seconds").append(a("<table>").addClass("table-condensed")),e=[D()];return z("h")&&e.push(b),z("m")&&e.push(c),z("s")&&e.push(d),e},F=function(){var b=[];return d.showTodayButton&&b.push(a("<td>").append(a("<a>").attr({"data-action":"today",title:d.tooltips.today}).append(a("<span>").addClass(d.icons.today)))),!d.sideBySide&&B()&&A()&&b.push(a("<td>").append(a("<a>").attr({"data-action":"togglePicker",title:d.tooltips.selectTime}).append(a("<span>").addClass(d.icons.time)))),d.showClear&&b.push(a("<td>").append(a("<a>").attr({"data-action":"clear",title:d.tooltips.clear}).append(a("<span>").addClass(d.icons.clear)))),d.showClose&&b.push(a("<td>").append(a("<a>").attr({"data-action":"close",title:d.tooltips.close}).append(a("<span>").addClass(d.icons.close)))),a("<table>").addClass("table-condensed").append(a("<tbody>").append(a("<tr>").append(b)))},G=function(){var b=a("<div>").addClass("bootstrap-datetimepicker-widget dropdown-menu"),c=a("<div>").addClass("datepicker").append(C()),e=a("<div>").addClass("timepicker").append(E()),f=a("<ul>").addClass("list-unstyled"),g=a("<li>").addClass("picker-switch"+(d.collapse?" accordion-toggle":"")).append(F());return d.inline&&b.removeClass("dropdown-menu"),h&&b.addClass("usetwentyfour"),z("s")&&!h&&b.addClass("wider"),d.sideBySide&&B()&&A()?(b.addClass("timepicker-sbs"),"top"===d.toolbarPlacement&&b.append(g),b.append(a("<div>").addClass("row").append(c.addClass("col-md-6")).append(e.addClass("col-md-6"))),"bottom"===d.toolbarPlacement&&b.append(g),b):("top"===d.toolbarPlacement&&f.append(g),B()&&f.append(a("<li>").addClass(d.collapse&&A()?"collapse in":"").append(c)),"default"===d.toolbarPlacement&&f.append(g),A()&&f.append(a("<li>").addClass(d.collapse&&B()?"collapse":"").append(e)),"bottom"===d.toolbarPlacement&&f.append(g),b.append(f))},H=function(){var b,e={};return b=c.is("input")||d.inline?c.data():c.find("input").data(),b.dateOptions&&b.dateOptions instanceof Object&&(e=a.extend(!0,e,b.dateOptions)),a.each(d,function(a){var c="date"+a.charAt(0).toUpperCase()+a.slice(1);void 0!==b[c]&&(e[a]=b[c])}),e},I=function(){var b,e=(n||c).position(),f=(n||c).offset(),g=d.widgetPositioning.vertical,h=d.widgetPositioning.horizontal;if(d.widgetParent)b=d.widgetParent.append(o);else if(c.is("input"))b=c.after(o).parent();else{if(d.inline)return void(b=c.append(o));b=c,c.children().first().after(o)}if("auto"===g&&(g=f.top+1.5*o.height()>=a(window).height()+a(window).scrollTop()&&o.height()+c.outerHeight()<f.top?"top":"bottom"),"auto"===h&&(h=b.width()<f.left+o.outerWidth()/2&&f.left+o.outerWidth()>a(window).width()?"right":"left"),"top"===g?o.addClass("top").removeClass("bottom"):o.addClass("bottom").removeClass("top"),"right"===h?o.addClass("pull-right"):o.removeClass("pull-right"),"static"===b.css("position")&&(b=b.parents().filter(function(){return"static"!==a(this).css("position")}).first()),0===b.length)throw new Error("datetimepicker component should be placed within a non-static positioned container");o.css({top:"top"===g?"auto":e.top+c.outerHeight(),bottom:"top"===g?b.outerHeight()-(b===c?0:e.top):"auto",left:"left"===h?b===c?0:e.left:"auto",right:"left"===h?"auto":b.outerWidth()-c.outerWidth()-(b===c?0:e.left)})},J=function(a){"dp.change"===a.type&&(a.date&&a.date.isSame(a.oldDate)||!a.date&&!a.oldDate)||c.trigger(a)},K=function(a){"y"===a&&(a="YYYY"),J({type:"dp.update",change:a,viewDate:f.clone()})},L=function(a){o&&(a&&(k=Math.max(p,Math.min(3,k+a))),o.find(".datepicker > div").hide().filter(".datepicker-"+q[k].clsName).show())},M=function(){var b=a("<tr>"),c=f.clone().startOf("w").startOf("d");for(d.calendarWeeks===!0&&b.append(a("<th>").addClass("cw").text("#"));c.isBefore(f.clone().endOf("w"));)b.append(a("<th>").addClass("dow").text(c.format("dd"))),c.add(1,"d");o.find(".datepicker-days thead").append(b)},N=function(a){return d.disabledDates[a.format("YYYY-MM-DD")]===!0},O=function(a){return d.enabledDates[a.format("YYYY-MM-DD")]===!0},P=function(a){return d.disabledHours[a.format("H")]===!0},Q=function(a){return d.enabledHours[a.format("H")]===!0},R=function(b,c){if(!b.isValid())return!1;if(d.disabledDates&&"d"===c&&N(b))return!1;if(d.enabledDates&&"d"===c&&!O(b))return!1;if(d.minDate&&b.isBefore(d.minDate,c))return!1;if(d.maxDate&&b.isAfter(d.maxDate,c))return!1;if(d.daysOfWeekDisabled&&"d"===c&&d.daysOfWeekDisabled.indexOf(b.day())!==-1)return!1;if(d.disabledHours&&("h"===c||"m"===c||"s"===c)&&P(b))return!1;if(d.enabledHours&&("h"===c||"m"===c||"s"===c)&&!Q(b))return!1;if(d.disabledTimeIntervals&&("h"===c||"m"===c||"s"===c)){var e=!1;if(a.each(d.disabledTimeIntervals,function(){if(b.isBetween(this[0],this[1]))return e=!0,!1}),e)return!1}return!0},S=function(){for(var b=[],c=f.clone().startOf("y").startOf("d");c.isSame(f,"y");)b.push(a("<span>").attr("data-action","selectMonth").addClass("month").text(c.format("MMM"))),c.add(1,"M");o.find(".datepicker-months td").empty().append(b)},T=function(){var b=o.find(".datepicker-months"),c=b.find("th"),g=b.find("tbody").find("span");c.eq(0).find("span").attr("title",d.tooltips.prevYear),c.eq(1).attr("title",d.tooltips.selectYear),c.eq(2).find("span").attr("title",d.tooltips.nextYear),b.find(".disabled").removeClass("disabled"),R(f.clone().subtract(1,"y"),"y")||c.eq(0).addClass("disabled"),c.eq(1).text(f.year()),R(f.clone().add(1,"y"),"y")||c.eq(2).addClass("disabled"),g.removeClass("active"),e.isSame(f,"y")&&!m&&g.eq(e.month()).addClass("active"),g.each(function(b){R(f.clone().month(b),"M")||a(this).addClass("disabled")})},U=function(){var a=o.find(".datepicker-years"),b=a.find("th"),c=f.clone().subtract(5,"y"),g=f.clone().add(6,"y"),h="";for(b.eq(0).find("span").attr("title",d.tooltips.prevDecade),b.eq(1).attr("title",d.tooltips.selectDecade),b.eq(2).find("span").attr("title",d.tooltips.nextDecade),a.find(".disabled").removeClass("disabled"),d.minDate&&d.minDate.isAfter(c,"y")&&b.eq(0).addClass("disabled"),b.eq(1).text(c.year()+"-"+g.year()),d.maxDate&&d.maxDate.isBefore(g,"y")&&b.eq(2).addClass("disabled");!c.isAfter(g,"y");)h+='<span data-action="selectYear" class="year'+(c.isSame(e,"y")&&!m?" active":"")+(R(c,"y")?"":" disabled")+'">'+c.year()+"</span>",c.add(1,"y");a.find("td").html(h)},V=function(){var a,c=o.find(".datepicker-decades"),g=c.find("th"),h=b({y:f.year()-f.year()%100-1}),i=h.clone().add(100,"y"),j=h.clone(),k=!1,l=!1,m="";for(g.eq(0).find("span").attr("title",d.tooltips.prevCentury),g.eq(2).find("span").attr("title",d.tooltips.nextCentury),c.find(".disabled").removeClass("disabled"),(h.isSame(b({y:1900}))||d.minDate&&d.minDate.isAfter(h,"y"))&&g.eq(0).addClass("disabled"),g.eq(1).text(h.year()+"-"+i.year()),(h.isSame(b({y:2e3}))||d.maxDate&&d.maxDate.isBefore(i,"y"))&&g.eq(2).addClass("disabled");!h.isAfter(i,"y");)a=h.year()+12,k=d.minDate&&d.minDate.isAfter(h,"y")&&d.minDate.year()<=a,l=d.maxDate&&d.maxDate.isAfter(h,"y")&&d.maxDate.year()<=a,m+='<span data-action="selectDecade" class="decade'+(e.isAfter(h)&&e.year()<=a?" active":"")+(R(h,"y")||k||l?"":" disabled")+'" data-selection="'+(h.year()+6)+'">'+(h.year()+1)+" - "+(h.year()+12)+"</span>",h.add(12,"y");m+="<span></span><span></span><span></span>",c.find("td").html(m),g.eq(1).text(j.year()+1+"-"+h.year())},W=function(){var b,c,g,h=o.find(".datepicker-days"),i=h.find("th"),j=[],k=[];if(B()){for(i.eq(0).find("span").attr("title",d.tooltips.prevMonth),i.eq(1).attr("title",d.tooltips.selectMonth),i.eq(2).find("span").attr("title",d.tooltips.nextMonth),h.find(".disabled").removeClass("disabled"),i.eq(1).text(f.format(d.dayViewHeaderFormat)),R(f.clone().subtract(1,"M"),"M")||i.eq(0).addClass("disabled"),R(f.clone().add(1,"M"),"M")||i.eq(2).addClass("disabled"),b=f.clone().startOf("M").startOf("w").startOf("d"),g=0;g<42;g++)0===b.weekday()&&(c=a("<tr>"),d.calendarWeeks&&c.append('<td class="cw">'+b.week()+"</td>"),j.push(c)),k=["day"],b.isBefore(f,"M")&&k.push("old"),b.isAfter(f,"M")&&k.push("new"),b.isSame(e,"d")&&!m&&k.push("active"),R(b,"d")||k.push("disabled"),b.isSame(y(),"d")&&k.push("today"),0!==b.day()&&6!==b.day()||k.push("weekend"),J({type:"dp.classify",date:b,classNames:k}),c.append('<td data-action="selectDay" data-day="'+b.format("L")+'" class="'+k.join(" ")+'">'+b.date()+"</td>"),b.add(1,"d");h.find("tbody").empty().append(j),T(),U(),V()}},X=function(){var b=o.find(".timepicker-hours table"),c=f.clone().startOf("d"),d=[],e=a("<tr>");for(f.hour()>11&&!h&&c.hour(12);c.isSame(f,"d")&&(h||f.hour()<12&&c.hour()<12||f.hour()>11);)c.hour()%4===0&&(e=a("<tr>"),d.push(e)),e.append('<td data-action="selectHour" class="hour'+(R(c,"h")?"":" disabled")+'">'+c.format(h?"HH":"hh")+"</td>"),c.add(1,"h");b.empty().append(d)},Y=function(){for(var b=o.find(".timepicker-minutes table"),c=f.clone().startOf("h"),e=[],g=a("<tr>"),h=1===d.stepping?5:d.stepping;f.isSame(c,"h");)c.minute()%(4*h)===0&&(g=a("<tr>"),e.push(g)),g.append('<td data-action="selectMinute" class="minute'+(R(c,"m")?"":" disabled")+'">'+c.format("mm")+"</td>"),c.add(h,"m");b.empty().append(e)},Z=function(){for(var b=o.find(".timepicker-seconds table"),c=f.clone().startOf("m"),d=[],e=a("<tr>");f.isSame(c,"m");)c.second()%20===0&&(e=a("<tr>"),d.push(e)),e.append('<td data-action="selectSecond" class="second'+(R(c,"s")?"":" disabled")+'">'+c.format("ss")+"</td>"),c.add(5,"s");b.empty().append(d)},$=function(){var a,b,c=o.find(".timepicker span[data-time-component]");h||(a=o.find(".timepicker [data-action=togglePeriod]"),b=e.clone().add(e.hours()>=12?-12:12,"h"),a.text(e.format("A")),R(b,"h")?a.removeClass("disabled"):a.addClass("disabled")),c.filter("[data-time-component=hours]").text(e.format(h?"HH":"hh")),c.filter("[data-time-component=minutes]").text(e.format("mm")),c.filter("[data-time-component=seconds]").text(e.format("ss")),X(),Y(),Z()},_=function(){o&&(W(),$())},aa=function(a){var b=m?null:e;if(!a)return m=!0,g.val(""),c.data("date",""),J({type:"dp.change",date:!1,oldDate:b}),void _();if(a=a.clone().locale(d.locale),x()&&a.tz(d.timeZone),1!==d.stepping)for(a.minutes(Math.round(a.minutes()/d.stepping)*d.stepping).seconds(0);d.minDate&&a.isBefore(d.minDate);)a.add(d.stepping,"minutes");R(a)?(e=a,f=e.clone(),g.val(e.format(i)),c.data("date",e.format(i)),m=!1,_(),J({type:"dp.change",date:e.clone(),oldDate:b})):(d.keepInvalid?J({type:"dp.change",date:a,oldDate:b}):g.val(m?"":e.format(i)),J({type:"dp.error",date:a,oldDate:b}))},ba=function(){var b=!1;return o?(o.find(".collapse").each(function(){var c=a(this).data("collapse");return!c||!c.transitioning||(b=!0,!1)}),b?l:(n&&n.hasClass("btn")&&n.toggleClass("active"),o.hide(),a(window).off("resize",I),o.off("click","[data-action]"),o.off("mousedown",!1),o.remove(),o=!1,J({type:"dp.hide",date:e.clone()}),g.blur(),f=e.clone(),l)):l},ca=function(){aa(null)},da=function(a){return void 0===d.parseInputDate?(!b.isMoment(a)||a instanceof Date)&&(a=y(a)):a=d.parseInputDate(a),a},ea={next:function(){var a=q[k].navFnc;f.add(q[k].navStep,a),W(),K(a)},previous:function(){var a=q[k].navFnc;f.subtract(q[k].navStep,a),W(),K(a)},pickerSwitch:function(){L(1)},selectMonth:function(b){var c=a(b.target).closest("tbody").find("span").index(a(b.target));f.month(c),k===p?(aa(e.clone().year(f.year()).month(f.month())),d.inline||ba()):(L(-1),W()),K("M")},selectYear:function(b){var c=parseInt(a(b.target).text(),10)||0;f.year(c),k===p?(aa(e.clone().year(f.year())),d.inline||ba()):(L(-1),W()),K("YYYY")},selectDecade:function(b){var c=parseInt(a(b.target).data("selection"),10)||0;f.year(c),k===p?(aa(e.clone().year(f.year())),d.inline||ba()):(L(-1),W()),K("YYYY")},selectDay:function(b){var c=f.clone();a(b.target).is(".old")&&c.subtract(1,"M"),a(b.target).is(".new")&&c.add(1,"M"),aa(c.date(parseInt(a(b.target).text(),10))),A()||d.keepOpen||d.inline||ba()},incrementHours:function(){var a=e.clone().add(1,"h");R(a,"h")&&aa(a)},incrementMinutes:function(){var a=e.clone().add(d.stepping,"m");R(a,"m")&&aa(a)},incrementSeconds:function(){var a=e.clone().add(1,"s");R(a,"s")&&aa(a)},decrementHours:function(){var a=e.clone().subtract(1,"h");R(a,"h")&&aa(a)},decrementMinutes:function(){var a=e.clone().subtract(d.stepping,"m");R(a,"m")&&aa(a)},decrementSeconds:function(){var a=e.clone().subtract(1,"s");R(a,"s")&&aa(a)},togglePeriod:function(){aa(e.clone().add(e.hours()>=12?-12:12,"h"))},togglePicker:function(b){var c,e=a(b.target),f=e.closest("ul"),g=f.find(".in"),h=f.find(".collapse:not(.in)");if(g&&g.length){if(c=g.data("collapse"),c&&c.transitioning)return;g.collapse?(g.collapse("hide"),h.collapse("show")):(g.removeClass("in"),h.addClass("in")),e.is("span")?e.toggleClass(d.icons.time+" "+d.icons.date):e.find("span").toggleClass(d.icons.time+" "+d.icons.date)}},showPicker:function(){o.find(".timepicker > div:not(.timepicker-picker)").hide(),o.find(".timepicker .timepicker-picker").show()},showHours:function(){o.find(".timepicker .timepicker-picker").hide(),o.find(".timepicker .timepicker-hours").show()},showMinutes:function(){o.find(".timepicker .timepicker-picker").hide(),o.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){o.find(".timepicker .timepicker-picker").hide(),o.find(".timepicker .timepicker-seconds").show()},selectHour:function(b){var c=parseInt(a(b.target).text(),10);h||(e.hours()>=12?12!==c&&(c+=12):12===c&&(c=0)),aa(e.clone().hours(c)),ea.showPicker.call(l)},selectMinute:function(b){aa(e.clone().minutes(parseInt(a(b.target).text(),10))),ea.showPicker.call(l)},selectSecond:function(b){aa(e.clone().seconds(parseInt(a(b.target).text(),10))),ea.showPicker.call(l)},clear:ca,today:function(){var a=y();R(a,"d")&&aa(a)},close:ba},fa=function(b){return!a(b.currentTarget).is(".disabled")&&(ea[a(b.currentTarget).data("action")].apply(l,arguments),!1)},ga=function(){var b,c={year:function(a){return a.month(0).date(1).hours(0).seconds(0).minutes(0)},month:function(a){return a.date(1).hours(0).seconds(0).minutes(0)},day:function(a){return a.hours(0).seconds(0).minutes(0)},hour:function(a){return a.seconds(0).minutes(0)},minute:function(a){return a.seconds(0)}};return g.prop("disabled")||!d.ignoreReadonly&&g.prop("readonly")||o?l:(void 0!==g.val()&&0!==g.val().trim().length?aa(da(g.val().trim())):m&&d.useCurrent&&(d.inline||g.is("input")&&0===g.val().trim().length)&&(b=y(),"string"==typeof d.useCurrent&&(b=c[d.useCurrent](b)),aa(b)),o=G(),M(),S(),o.find(".timepicker-hours").hide(),o.find(".timepicker-minutes").hide(),o.find(".timepicker-seconds").hide(),_(),L(),a(window).on("resize",I),o.on("click","[data-action]",fa),o.on("mousedown",!1),n&&n.hasClass("btn")&&n.toggleClass("active"),I(),o.show(),d.focusOnShow&&!g.is(":focus")&&g.focus(),J({type:"dp.show"}),l)},ha=function(){return o?ba():ga()},ia=function(a){var b,c,e,f,g=null,h=[],i={},j=a.which,k="p";w[j]=k;for(b in w)w.hasOwnProperty(b)&&w[b]===k&&(h.push(b),parseInt(b,10)!==j&&(i[b]=!0));for(b in d.keyBinds)if(d.keyBinds.hasOwnProperty(b)&&"function"==typeof d.keyBinds[b]&&(e=b.split(" "),e.length===h.length&&v[j]===e[e.length-1])){for(f=!0,c=e.length-2;c>=0;c--)if(!(v[e[c]]in i)){f=!1;break}if(f){g=d.keyBinds[b];break}}g&&(g.call(l,o),a.stopPropagation(),a.preventDefault())},ja=function(a){w[a.which]="r",a.stopPropagation(),a.preventDefault()},ka=function(b){var c=a(b.target).val().trim(),d=c?da(c):null;return aa(d),b.stopImmediatePropagation(),!1},la=function(){g.on({change:ka,blur:d.debug?"":ba,keydown:ia,keyup:ja,focus:d.allowInputToggle?ga:""}),c.is("input")?g.on({focus:ga}):n&&(n.on("click",ha),n.on("mousedown",!1))},ma=function(){g.off({change:ka,blur:blur,keydown:ia,keyup:ja,focus:d.allowInputToggle?ba:""}),c.is("input")?g.off({focus:ga}):n&&(n.off("click",ha),n.off("mousedown",!1))},na=function(b){var c={};return a.each(b,function(){var a=da(this);a.isValid()&&(c[a.format("YYYY-MM-DD")]=!0)}),!!Object.keys(c).length&&c},oa=function(b){var c={};return a.each(b,function(){c[this]=!0}),!!Object.keys(c).length&&c},pa=function(){var a=d.format||"L LT";i=a.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(a){var b=e.localeData().longDateFormat(a)||a;return b.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(a){return e.localeData().longDateFormat(a)||a})}),j=d.extraFormats?d.extraFormats.slice():[],j.indexOf(a)<0&&j.indexOf(i)<0&&j.push(i),h=i.toLowerCase().indexOf("a")<1&&i.replace(/\[.*?\]/g,"").indexOf("h")<1,z("y")&&(p=2),z("M")&&(p=1),z("d")&&(p=0),k=Math.max(p,k),m||aa(e)};if(l.destroy=function(){ba(),ma(),c.removeData("DateTimePicker"),c.removeData("date")},l.toggle=ha,l.show=ga,l.hide=ba,l.disable=function(){return ba(),n&&n.hasClass("btn")&&n.addClass("disabled"),g.prop("disabled",!0),l},l.enable=function(){return n&&n.hasClass("btn")&&n.removeClass("disabled"),g.prop("disabled",!1),l},l.ignoreReadonly=function(a){if(0===arguments.length)return d.ignoreReadonly;if("boolean"!=typeof a)throw new TypeError("ignoreReadonly () expects a boolean parameter");return d.ignoreReadonly=a,l},l.options=function(b){if(0===arguments.length)return a.extend(!0,{},d);if(!(b instanceof Object))throw new TypeError("options() options parameter should be an object");return a.extend(!0,d,b),a.each(d,function(a,b){if(void 0===l[a])throw new TypeError("option "+a+" is not recognized!");l[a](b)}),l},l.date=function(a){if(0===arguments.length)return m?null:e.clone();if(!(null===a||"string"==typeof a||b.isMoment(a)||a instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");return aa(null===a?null:da(a)),l},l.format=function(a){if(0===arguments.length)return d.format;if("string"!=typeof a&&("boolean"!=typeof a||a!==!1))throw new TypeError("format() expects a string or boolean:false parameter "+a);return d.format=a,i&&pa(),l},l.timeZone=function(a){if(0===arguments.length)return d.timeZone;if("string"!=typeof a)throw new TypeError("newZone() expects a string parameter");return d.timeZone=a,l},l.dayViewHeaderFormat=function(a){if(0===arguments.length)return d.dayViewHeaderFormat;if("string"!=typeof a)throw new TypeError("dayViewHeaderFormat() expects a string parameter");return d.dayViewHeaderFormat=a,l},l.extraFormats=function(a){if(0===arguments.length)return d.extraFormats;if(a!==!1&&!(a instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");return d.extraFormats=a,j&&pa(),l},l.disabledDates=function(b){if(0===arguments.length)return d.disabledDates?a.extend({},d.disabledDates):d.disabledDates;if(!b)return d.disabledDates=!1,_(),l;if(!(b instanceof Array))throw new TypeError("disabledDates() expects an array parameter");return d.disabledDates=na(b),d.enabledDates=!1,_(),l},l.enabledDates=function(b){if(0===arguments.length)return d.enabledDates?a.extend({},d.enabledDates):d.enabledDates;if(!b)return d.enabledDates=!1,_(),l;if(!(b instanceof Array))throw new TypeError("enabledDates() expects an array parameter");return d.enabledDates=na(b),d.disabledDates=!1,_(),l},l.daysOfWeekDisabled=function(a){if(0===arguments.length)return d.daysOfWeekDisabled.splice(0);if("boolean"==typeof a&&!a)return d.daysOfWeekDisabled=!1,_(),l;if(!(a instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(d.daysOfWeekDisabled=a.reduce(function(a,b){return b=parseInt(b,10),b>6||b<0||isNaN(b)?a:(a.indexOf(b)===-1&&a.push(b),a)},[]).sort(),d.useCurrent&&!d.keepInvalid){for(var b=0;!R(e,"d");){if(e.add(1,"d"),31===b)throw"Tried 31 times to find a valid date";b++}aa(e)}return _(),l},l.maxDate=function(a){if(0===arguments.length)return d.maxDate?d.maxDate.clone():d.maxDate;if("boolean"==typeof a&&a===!1)return d.maxDate=!1,_(),l;"string"==typeof a&&("now"!==a&&"moment"!==a||(a=y()));var b=da(a);if(!b.isValid())throw new TypeError("maxDate() Could not parse date parameter: "+a);if(d.minDate&&b.isBefore(d.minDate))throw new TypeError("maxDate() date parameter is before options.minDate: "+b.format(i));return d.maxDate=b,d.useCurrent&&!d.keepInvalid&&e.isAfter(a)&&aa(d.maxDate),f.isAfter(b)&&(f=b.clone().subtract(d.stepping,"m")),_(),l},l.minDate=function(a){if(0===arguments.length)return d.minDate?d.minDate.clone():d.minDate;if("boolean"==typeof a&&a===!1)return d.minDate=!1,_(),l;"string"==typeof a&&("now"!==a&&"moment"!==a||(a=y()));var b=da(a);if(!b.isValid())throw new TypeError("minDate() Could not parse date parameter: "+a);if(d.maxDate&&b.isAfter(d.maxDate))throw new TypeError("minDate() date parameter is after options.maxDate: "+b.format(i));return d.minDate=b,d.useCurrent&&!d.keepInvalid&&e.isBefore(a)&&aa(d.minDate),f.isBefore(b)&&(f=b.clone().add(d.stepping,"m")),_(),l},l.defaultDate=function(a){if(0===arguments.length)return d.defaultDate?d.defaultDate.clone():d.defaultDate;if(!a)return d.defaultDate=!1,l;"string"==typeof a&&(a="now"===a||"moment"===a?y():y(a));var b=da(a);if(!b.isValid())throw new TypeError("defaultDate() Could not parse date parameter: "+a);if(!R(b))throw new TypeError("defaultDate() date passed is invalid according to component setup validations");return d.defaultDate=b,(d.defaultDate&&d.inline||""===g.val().trim())&&aa(d.defaultDate),l},l.locale=function(a){if(0===arguments.length)return d.locale;if(!b.localeData(a))throw new TypeError("locale() locale "+a+" is not loaded from moment locales!");return d.locale=a,e.locale(d.locale),f.locale(d.locale),i&&pa(),o&&(ba(),ga()),l},l.stepping=function(a){return 0===arguments.length?d.stepping:(a=parseInt(a,10),(isNaN(a)||a<1)&&(a=1),d.stepping=a,l)},l.useCurrent=function(a){var b=["year","month","day","hour","minute"];if(0===arguments.length)return d.useCurrent;if("boolean"!=typeof a&&"string"!=typeof a)throw new TypeError("useCurrent() expects a boolean or string parameter");if("string"==typeof a&&b.indexOf(a.toLowerCase())===-1)throw new TypeError("useCurrent() expects a string parameter of "+b.join(", "));return d.useCurrent=a,l},l.collapse=function(a){if(0===arguments.length)return d.collapse;if("boolean"!=typeof a)throw new TypeError("collapse() expects a boolean parameter");return d.collapse===a?l:(d.collapse=a,o&&(ba(),ga()),l)},l.icons=function(b){if(0===arguments.length)return a.extend({},d.icons);if(!(b instanceof Object))throw new TypeError("icons() expects parameter to be an Object");return a.extend(d.icons,b),o&&(ba(),ga()),l},l.tooltips=function(b){if(0===arguments.length)return a.extend({},d.tooltips);if(!(b instanceof Object))throw new TypeError("tooltips() expects parameter to be an Object");return a.extend(d.tooltips,b),o&&(ba(),ga()),l},l.useStrict=function(a){if(0===arguments.length)return d.useStrict;if("boolean"!=typeof a)throw new TypeError("useStrict() expects a boolean parameter");return d.useStrict=a,l},l.sideBySide=function(a){if(0===arguments.length)return d.sideBySide;if("boolean"!=typeof a)throw new TypeError("sideBySide() expects a boolean parameter");return d.sideBySide=a,o&&(ba(),ga()),l},l.viewMode=function(a){if(0===arguments.length)return d.viewMode;if("string"!=typeof a)throw new TypeError("viewMode() expects a string parameter");if(r.indexOf(a)===-1)throw new TypeError("viewMode() parameter must be one of ("+r.join(", ")+") value");return d.viewMode=a,k=Math.max(r.indexOf(a),p),L(),l},l.toolbarPlacement=function(a){if(0===arguments.length)return d.toolbarPlacement;if("string"!=typeof a)throw new TypeError("toolbarPlacement() expects a string parameter");if(u.indexOf(a)===-1)throw new TypeError("toolbarPlacement() parameter must be one of ("+u.join(", ")+") value");return d.toolbarPlacement=a,o&&(ba(),ga()),l},l.widgetPositioning=function(b){if(0===arguments.length)return a.extend({},d.widgetPositioning);if("[object Object]"!=={}.toString.call(b))throw new TypeError("widgetPositioning() expects an object variable");if(b.horizontal){if("string"!=typeof b.horizontal)throw new TypeError("widgetPositioning() horizontal variable must be a string");if(b.horizontal=b.horizontal.toLowerCase(),t.indexOf(b.horizontal)===-1)throw new TypeError("widgetPositioning() expects horizontal parameter to be one of ("+t.join(", ")+")");d.widgetPositioning.horizontal=b.horizontal}if(b.vertical){if("string"!=typeof b.vertical)throw new TypeError("widgetPositioning() vertical variable must be a string");if(b.vertical=b.vertical.toLowerCase(),s.indexOf(b.vertical)===-1)throw new TypeError("widgetPositioning() expects vertical parameter to be one of ("+s.join(", ")+")");d.widgetPositioning.vertical=b.vertical}return _(),l},l.calendarWeeks=function(a){if(0===arguments.length)return d.calendarWeeks;if("boolean"!=typeof a)throw new TypeError("calendarWeeks() expects parameter to be a boolean value");return d.calendarWeeks=a,_(),l},l.showTodayButton=function(a){if(0===arguments.length)return d.showTodayButton;if("boolean"!=typeof a)throw new TypeError("showTodayButton() expects a boolean parameter");return d.showTodayButton=a,o&&(ba(),ga()),l},l.showClear=function(a){if(0===arguments.length)return d.showClear;if("boolean"!=typeof a)throw new TypeError("showClear() expects a boolean parameter");return d.showClear=a,o&&(ba(),ga()),l},l.widgetParent=function(b){if(0===arguments.length)return d.widgetParent;if("string"==typeof b&&(b=a(b)),null!==b&&"string"!=typeof b&&!(b instanceof a))throw new TypeError("widgetParent() expects a string or a jQuery object parameter");return d.widgetParent=b,o&&(ba(),ga()),l},l.keepOpen=function(a){if(0===arguments.length)return d.keepOpen;if("boolean"!=typeof a)throw new TypeError("keepOpen() expects a boolean parameter");return d.keepOpen=a,l},l.focusOnShow=function(a){if(0===arguments.length)return d.focusOnShow;if("boolean"!=typeof a)throw new TypeError("focusOnShow() expects a boolean parameter");return d.focusOnShow=a,l},l.inline=function(a){if(0===arguments.length)return d.inline;if("boolean"!=typeof a)throw new TypeError("inline() expects a boolean parameter");return d.inline=a,l},l.clear=function(){return ca(),l},l.keyBinds=function(a){return 0===arguments.length?d.keyBinds:(d.keyBinds=a,l)},l.getMoment=function(a){return y(a)},l.debug=function(a){if("boolean"!=typeof a)throw new TypeError("debug() expects a boolean parameter");return d.debug=a,l},l.allowInputToggle=function(a){if(0===arguments.length)return d.allowInputToggle;if("boolean"!=typeof a)throw new TypeError("allowInputToggle() expects a boolean parameter");return d.allowInputToggle=a,l},l.showClose=function(a){if(0===arguments.length)return d.showClose;if("boolean"!=typeof a)throw new TypeError("showClose() expects a boolean parameter");return d.showClose=a,l},l.keepInvalid=function(a){if(0===arguments.length)return d.keepInvalid;if("boolean"!=typeof a)throw new TypeError("keepInvalid() expects a boolean parameter");
2
+ return d.keepInvalid=a,l},l.datepickerInput=function(a){if(0===arguments.length)return d.datepickerInput;if("string"!=typeof a)throw new TypeError("datepickerInput() expects a string parameter");return d.datepickerInput=a,l},l.parseInputDate=function(a){if(0===arguments.length)return d.parseInputDate;if("function"!=typeof a)throw new TypeError("parseInputDate() sholud be as function");return d.parseInputDate=a,l},l.disabledTimeIntervals=function(b){if(0===arguments.length)return d.disabledTimeIntervals?a.extend({},d.disabledTimeIntervals):d.disabledTimeIntervals;if(!b)return d.disabledTimeIntervals=!1,_(),l;if(!(b instanceof Array))throw new TypeError("disabledTimeIntervals() expects an array parameter");return d.disabledTimeIntervals=b,_(),l},l.disabledHours=function(b){if(0===arguments.length)return d.disabledHours?a.extend({},d.disabledHours):d.disabledHours;if(!b)return d.disabledHours=!1,_(),l;if(!(b instanceof Array))throw new TypeError("disabledHours() expects an array parameter");if(d.disabledHours=oa(b),d.enabledHours=!1,d.useCurrent&&!d.keepInvalid){for(var c=0;!R(e,"h");){if(e.add(1,"h"),24===c)throw"Tried 24 times to find a valid date";c++}aa(e)}return _(),l},l.enabledHours=function(b){if(0===arguments.length)return d.enabledHours?a.extend({},d.enabledHours):d.enabledHours;if(!b)return d.enabledHours=!1,_(),l;if(!(b instanceof Array))throw new TypeError("enabledHours() expects an array parameter");if(d.enabledHours=oa(b),d.disabledHours=!1,d.useCurrent&&!d.keepInvalid){for(var c=0;!R(e,"h");){if(e.add(1,"h"),24===c)throw"Tried 24 times to find a valid date";c++}aa(e)}return _(),l},l.viewDate=function(a){if(0===arguments.length)return f.clone();if(!a)return f=e.clone(),l;if(!("string"==typeof a||b.isMoment(a)||a instanceof Date))throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");return f=da(a),K(),l},c.is("input"))g=c;else if(g=c.find(d.datepickerInput),0===g.length)g=c.find("input");else if(!g.is("input"))throw new Error('CSS class "'+d.datepickerInput+'" cannot be applied to non input element');if(c.hasClass("input-group")&&(n=0===c.find(".datepickerbutton").length?c.find(".input-group-addon"):c.find(".datepickerbutton")),!d.inline&&!g.is("input"))throw new Error("Could not initialize DateTimePicker without an input element");return e=y(),f=e.clone(),a.extend(!0,d,H()),l.options(d),pa(),la(),g.prop("disabled")&&l.disable(),g.is("input")&&0!==g.val().trim().length?aa(da(g.val().trim())):d.defaultDate&&void 0===g.attr("placeholder")&&aa(d.defaultDate),d.inline&&ga(),l};return a.fn.datetimepicker=function(b){b=b||{};var d,e=Array.prototype.slice.call(arguments,1),f=!0,g=["destroy","hide","show","toggle"];if("object"==typeof b)return this.each(function(){var d,e=a(this);e.data("DateTimePicker")||(d=a.extend(!0,{},a.fn.datetimepicker.defaults,b),e.data("DateTimePicker",c(e,d)))});if("string"==typeof b)return this.each(function(){var c=a(this),g=c.data("DateTimePicker");if(!g)throw new Error('bootstrap-datetimepicker("'+b+'") method was called on an element that is not using DateTimePicker');d=g[b].apply(g,e),f=d===g}),f||a.inArray(b,g)>-1?this:d;throw new TypeError("Invalid arguments for DateTimePicker: "+b)},a.fn.datetimepicker.defaults={timeZone:"",format:!1,dayViewHeaderFormat:"MMMM YYYY",extraFormats:!1,stepping:1,minDate:!1,maxDate:!1,useCurrent:!0,collapse:!0,locale:b.locale(),defaultDate:!1,disabledDates:!1,enabledDates:!1,icons:{time:"glyphicon glyphicon-time",date:"glyphicon glyphicon-calendar",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down",previous:"glyphicon glyphicon-chevron-left",next:"glyphicon glyphicon-chevron-right",today:"glyphicon glyphicon-screenshot",clear:"glyphicon glyphicon-trash",close:"glyphicon glyphicon-remove"},tooltips:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",prevMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",prevYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",togglePeriod:"Toggle Period",selectTime:"Select Time"},useStrict:!1,sideBySide:!1,daysOfWeekDisabled:!1,calendarWeeks:!1,viewMode:"days",toolbarPlacement:"default",showTodayButton:!1,showClear:!1,showClose:!1,widgetPositioning:{horizontal:"auto",vertical:"auto"},widgetParent:null,ignoreReadonly:!1,keepOpen:!1,focusOnShow:!0,inline:!1,keepInvalid:!1,datepickerInput:".datepickerinput",keyBinds:{up:function(a){if(a){var b=this.date()||this.getMoment();a.find(".datepicker").is(":visible")?this.date(b.clone().subtract(7,"d")):this.date(b.clone().add(this.stepping(),"m"))}},down:function(a){if(!a)return void this.show();var b=this.date()||this.getMoment();a.find(".datepicker").is(":visible")?this.date(b.clone().add(7,"d")):this.date(b.clone().subtract(this.stepping(),"m"))},"control up":function(a){if(a){var b=this.date()||this.getMoment();a.find(".datepicker").is(":visible")?this.date(b.clone().subtract(1,"y")):this.date(b.clone().add(1,"h"))}},"control down":function(a){if(a){var b=this.date()||this.getMoment();a.find(".datepicker").is(":visible")?this.date(b.clone().add(1,"y")):this.date(b.clone().subtract(1,"h"))}},left:function(a){if(a){var b=this.date()||this.getMoment();a.find(".datepicker").is(":visible")&&this.date(b.clone().subtract(1,"d"))}},right:function(a){if(a){var b=this.date()||this.getMoment();a.find(".datepicker").is(":visible")&&this.date(b.clone().add(1,"d"))}},pageUp:function(a){if(a){var b=this.date()||this.getMoment();a.find(".datepicker").is(":visible")&&this.date(b.clone().subtract(1,"M"))}},pageDown:function(a){if(a){var b=this.date()||this.getMoment();a.find(".datepicker").is(":visible")&&this.date(b.clone().add(1,"M"))}},enter:function(){this.hide()},escape:function(){this.hide()},"control space":function(a){a&&a.find(".timepicker").is(":visible")&&a.find('.btn[data-action="togglePeriod"]').click()},t:function(){this.date(this.getMoment())},delete:function(){this.clear()}},debug:!1,allowInputToggle:!1,disabledTimeIntervals:!1,disabledHours:!1,enabledHours:!1,viewDate:!1},a.fn.datetimepicker});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/bootstrap-datetimepicker/moment.min.js CHANGED
@@ -1,6 +1,5 @@
1
  //! moment.js
2
- //! version : 2.5.1
3
- //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4
  //! license : MIT
5
  //! momentjs.com
6
- (function(a){function b(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function c(a,b){return function(c){return k(a.call(this,c),b)}}function d(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function e(){}function f(a){w(a),h(this,a)}function g(a){var b=q(a),c=b.year||0,d=b.month||0,e=b.week||0,f=b.day||0,g=b.hour||0,h=b.minute||0,i=b.second||0,j=b.millisecond||0;this._milliseconds=+j+1e3*i+6e4*h+36e5*g,this._days=+f+7*e,this._months=+d+12*c,this._data={},this._bubble()}function h(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return b.hasOwnProperty("toString")&&(a.toString=b.toString),b.hasOwnProperty("valueOf")&&(a.valueOf=b.valueOf),a}function i(a){var b,c={};for(b in a)a.hasOwnProperty(b)&&qb.hasOwnProperty(b)&&(c[b]=a[b]);return c}function j(a){return 0>a?Math.ceil(a):Math.floor(a)}function k(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.length<b;)d="0"+d;return(e?c?"+":"":"-")+d}function l(a,b,c,d){var e,f,g=b._milliseconds,h=b._days,i=b._months;g&&a._d.setTime(+a._d+g*c),(h||i)&&(e=a.minute(),f=a.hour()),h&&a.date(a.date()+h*c),i&&a.month(a.month()+i*c),g&&!d&&db.updateOffset(a),(h||i)&&(a.minute(e),a.hour(f))}function m(a){return"[object Array]"===Object.prototype.toString.call(a)}function n(a){return"[object Date]"===Object.prototype.toString.call(a)||a instanceof Date}function o(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&s(a[d])!==s(b[d]))&&g++;return g+f}function p(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=Tb[a]||Ub[b]||b}return a}function q(a){var b,c,d={};for(c in a)a.hasOwnProperty(c)&&(b=p(c),b&&(d[b]=a[c]));return d}function r(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}db[b]=function(e,f){var g,h,i=db.fn._lang[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=db().utc().set(d,a);return i.call(db.fn._lang,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function s(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function t(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function u(a){return v(a)?366:365}function v(a){return a%4===0&&a%100!==0||a%400===0}function w(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[jb]<0||a._a[jb]>11?jb:a._a[kb]<1||a._a[kb]>t(a._a[ib],a._a[jb])?kb:a._a[lb]<0||a._a[lb]>23?lb:a._a[mb]<0||a._a[mb]>59?mb:a._a[nb]<0||a._a[nb]>59?nb:a._a[ob]<0||a._a[ob]>999?ob:-1,a._pf._overflowDayOfYear&&(ib>b||b>kb)&&(b=kb),a._pf.overflow=b)}function x(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&a._pf.overflow<0&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function y(a){return a?a.toLowerCase().replace("_","-"):a}function z(a,b){return b._isUTC?db(a).zone(b._offset||0):db(a).local()}function A(a,b){return b.abbr=a,pb[a]||(pb[a]=new e),pb[a].set(b),pb[a]}function B(a){delete pb[a]}function C(a){var b,c,d,e,f=0,g=function(a){if(!pb[a]&&rb)try{require("./lang/"+a)}catch(b){}return pb[a]};if(!a)return db.fn._lang;if(!m(a)){if(c=g(a))return c;a=[a]}for(;f<a.length;){for(e=y(a[f]).split("-"),b=e.length,d=y(a[f+1]),d=d?d.split("-"):null;b>0;){if(c=g(e.slice(0,b).join("-")))return c;if(d&&d.length>=b&&o(e,d,!0)>=b-1)break;b--}f++}return db.fn._lang}function D(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function E(a){var b,c,d=a.match(vb);for(b=0,c=d.length;c>b;b++)d[b]=Yb[d[b]]?Yb[d[b]]:D(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function F(a,b){return a.isValid()?(b=G(b,a.lang()),Vb[b]||(Vb[b]=E(b)),Vb[b](a)):a.lang().invalidDate()}function G(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(wb.lastIndex=0;d>=0&&wb.test(a);)a=a.replace(wb,c),wb.lastIndex=0,d-=1;return a}function H(a,b){var c,d=b._strict;switch(a){case"DDDD":return Ib;case"YYYY":case"GGGG":case"gggg":return d?Jb:zb;case"Y":case"G":case"g":return Lb;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?Kb:Ab;case"S":if(d)return Gb;case"SS":if(d)return Hb;case"SSS":if(d)return Ib;case"DDD":return yb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Cb;case"a":case"A":return C(b._l)._meridiemParse;case"X":return Fb;case"Z":case"ZZ":return Db;case"T":return Eb;case"SSSS":return Bb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?Hb:xb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return xb;default:return c=new RegExp(P(O(a.replace("\\","")),"i"))}}function I(a){a=a||"";var b=a.match(Db)||[],c=b[b.length-1]||[],d=(c+"").match(Qb)||["-",0,0],e=+(60*d[1])+s(d[2]);return"+"===d[0]?-e:e}function J(a,b,c){var d,e=c._a;switch(a){case"M":case"MM":null!=b&&(e[jb]=s(b)-1);break;case"MMM":case"MMMM":d=C(c._l).monthsParse(b),null!=d?e[jb]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[kb]=s(b));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=s(b));break;case"YY":e[ib]=s(b)+(s(b)>68?1900:2e3);break;case"YYYY":case"YYYYY":case"YYYYYY":e[ib]=s(b);break;case"a":case"A":c._isPm=C(c._l).isPM(b);break;case"H":case"HH":case"h":case"hh":e[lb]=s(b);break;case"m":case"mm":e[mb]=s(b);break;case"s":case"ss":e[nb]=s(b);break;case"S":case"SS":case"SSS":case"SSSS":e[ob]=s(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=I(b);break;case"w":case"ww":case"W":case"WW":case"d":case"dd":case"ddd":case"dddd":case"e":case"E":a=a.substr(0,1);case"gg":case"gggg":case"GG":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=b)}}function K(a){var b,c,d,e,f,g,h,i,j,k,l=[];if(!a._d){for(d=M(a),a._w&&null==a._a[kb]&&null==a._a[jb]&&(f=function(b){var c=parseInt(b,10);return b?b.length<3?c>68?1900+c:2e3+c:c:null==a._a[ib]?db().weekYear():a._a[ib]},g=a._w,null!=g.GG||null!=g.W||null!=g.E?h=Z(f(g.GG),g.W||1,g.E,4,1):(i=C(a._l),j=null!=g.d?V(g.d,i):null!=g.e?parseInt(g.e,10)+i._week.dow:0,k=parseInt(g.w,10)||1,null!=g.d&&j<i._week.dow&&k++,h=Z(f(g.gg),k,j,i._week.doy,i._week.dow)),a._a[ib]=h.year,a._dayOfYear=h.dayOfYear),a._dayOfYear&&(e=null==a._a[ib]?d[ib]:a._a[ib],a._dayOfYear>u(e)&&(a._pf._overflowDayOfYear=!0),c=U(e,0,a._dayOfYear),a._a[jb]=c.getUTCMonth(),a._a[kb]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=l[b]=d[b];for(;7>b;b++)a._a[b]=l[b]=null==a._a[b]?2===b?1:0:a._a[b];l[lb]+=s((a._tzm||0)/60),l[mb]+=s((a._tzm||0)%60),a._d=(a._useUTC?U:T).apply(null,l)}}function L(a){var b;a._d||(b=q(a._i),a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond],K(a))}function M(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function N(a){a._a=[],a._pf.empty=!0;var b,c,d,e,f,g=C(a._l),h=""+a._i,i=h.length,j=0;for(d=G(a._f,g).match(vb)||[],b=0;b<d.length;b++)e=d[b],c=(h.match(H(e,a))||[])[0],c&&(f=h.substr(0,h.indexOf(c)),f.length>0&&a._pf.unusedInput.push(f),h=h.slice(h.indexOf(c)+c.length),j+=c.length),Yb[e]?(c?a._pf.empty=!1:a._pf.unusedTokens.push(e),J(e,c,a)):a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=i-j,h.length>0&&a._pf.unusedInput.push(h),a._isPm&&a._a[lb]<12&&(a._a[lb]+=12),a._isPm===!1&&12===a._a[lb]&&(a._a[lb]=0),K(a),w(a)}function O(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function P(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(a){var c,d,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,a._d=new Date(0/0),void 0;for(f=0;f<a._f.length;f++)g=0,c=h({},a),c._pf=b(),c._f=a._f[f],N(c),x(c)&&(g+=c._pf.charsLeftOver,g+=10*c._pf.unusedTokens.length,c._pf.score=g,(null==e||e>g)&&(e=g,d=c));h(a,d||c)}function R(a){var b,c,d=a._i,e=Mb.exec(d);if(e){for(a._pf.iso=!0,b=0,c=Ob.length;c>b;b++)if(Ob[b][1].exec(d)){a._f=Ob[b][0]+(e[6]||" ");break}for(b=0,c=Pb.length;c>b;b++)if(Pb[b][1].exec(d)){a._f+=Pb[b][0];break}d.match(Db)&&(a._f+="Z"),N(a)}else a._d=new Date(d)}function S(b){var c=b._i,d=sb.exec(c);c===a?b._d=new Date:d?b._d=new Date(+d[1]):"string"==typeof c?R(b):m(c)?(b._a=c.slice(0),K(b)):n(c)?b._d=new Date(+c):"object"==typeof c?L(b):b._d=new Date(c)}function T(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function U(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function V(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function W(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function X(a,b,c){var d=hb(Math.abs(a)/1e3),e=hb(d/60),f=hb(e/60),g=hb(f/24),h=hb(g/365),i=45>d&&["s",d]||1===e&&["m"]||45>e&&["mm",e]||1===f&&["h"]||22>f&&["hh",f]||1===g&&["d"]||25>=g&&["dd",g]||45>=g&&["M"]||345>g&&["MM",hb(g/30)]||1===h&&["y"]||["yy",h];return i[2]=b,i[3]=a>0,i[4]=c,W.apply({},i)}function Y(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=db(a).add("d",f),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function Z(a,b,c,d,e){var f,g,h=U(a,0,1).getUTCDay();return c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:u(a-1)+g}}function $(a){var b=a._i,c=a._f;return null===b?db.invalid({nullInput:!0}):("string"==typeof b&&(a._i=b=C().preparse(b)),db.isMoment(b)?(a=i(b),a._d=new Date(+b._d)):c?m(c)?Q(a):N(a):S(a),new f(a))}function _(a,b){db.fn[a]=db.fn[a+"s"]=function(a){var c=this._isUTC?"UTC":"";return null!=a?(this._d["set"+c+b](a),db.updateOffset(this),this):this._d["get"+c+b]()}}function ab(a){db.duration.fn[a]=function(){return this._data[a]}}function bb(a,b){db.duration.fn["as"+a]=function(){return+this/b}}function cb(a){var b=!1,c=db;"undefined"==typeof ender&&(a?(gb.moment=function(){return!b&&console&&console.warn&&(b=!0,console.warn("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.")),c.apply(null,arguments)},h(gb.moment,c)):gb.moment=db)}for(var db,eb,fb="2.5.1",gb=this,hb=Math.round,ib=0,jb=1,kb=2,lb=3,mb=4,nb=5,ob=6,pb={},qb={_isAMomentObject:null,_i:null,_f:null,_l:null,_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},rb="undefined"!=typeof module&&module.exports&&"undefined"!=typeof require,sb=/^\/?Date\((\-?\d+)/i,tb=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,ub=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,vb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,wb=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,xb=/\d\d?/,yb=/\d{1,3}/,zb=/\d{1,4}/,Ab=/[+\-]?\d{1,6}/,Bb=/\d+/,Cb=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Db=/Z|[\+\-]\d\d:?\d\d/gi,Eb=/T/i,Fb=/[\+\-]?\d+(\.\d{1,3})?/,Gb=/\d/,Hb=/\d\d/,Ib=/\d{3}/,Jb=/\d{4}/,Kb=/[+-]?\d{6}/,Lb=/[+-]?\d+/,Mb=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Nb="YYYY-MM-DDTHH:mm:ssZ",Ob=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Pb=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Qb=/([\+\-]|\d\d)/gi,Rb="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),Sb={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},Tb={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},Ub={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},Vb={},Wb="DDD w W M D d".split(" "),Xb="M D H h m s w W".split(" "),Yb={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return k(this.year()%100,2)},YYYY:function(){return k(this.year(),4)},YYYYY:function(){return k(this.year(),5)},YYYYYY:function(){var a=this.year(),b=a>=0?"+":"-";return b+k(Math.abs(a),6)},gg:function(){return k(this.weekYear()%100,2)},gggg:function(){return k(this.weekYear(),4)},ggggg:function(){return k(this.weekYear(),5)},GG:function(){return k(this.isoWeekYear()%100,2)},GGGG:function(){return k(this.isoWeekYear(),4)},GGGGG:function(){return k(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return s(this.milliseconds()/100)},SS:function(){return k(s(this.milliseconds()/10),2)},SSS:function(){return k(this.milliseconds(),3)},SSSS:function(){return k(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+k(s(a/60),2)+":"+k(s(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+k(s(a/60),2)+k(s(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},Zb=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];Wb.length;)eb=Wb.pop(),Yb[eb+"o"]=d(Yb[eb],eb);for(;Xb.length;)eb=Xb.pop(),Yb[eb+eb]=c(Yb[eb],2);for(Yb.DDDD=c(Yb.DDD,3),h(e.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=db.utc([2e3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=db([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return Y(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),db=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=c,g._f=d,g._l=e,g._strict=f,g._isUTC=!1,g._pf=b(),$(g)},db.utc=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=c,g._f=d,g._strict=f,g._pf=b(),$(g).utc()},db.unix=function(a){return db(1e3*a)},db.duration=function(a,b){var c,d,e,f=a,h=null;return db.isDuration(a)?f={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(f={},b?f[b]=a:f.milliseconds=a):(h=tb.exec(a))?(c="-"===h[1]?-1:1,f={y:0,d:s(h[kb])*c,h:s(h[lb])*c,m:s(h[mb])*c,s:s(h[nb])*c,ms:s(h[ob])*c}):(h=ub.exec(a))&&(c="-"===h[1]?-1:1,e=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*c},f={y:e(h[2]),M:e(h[3]),d:e(h[4]),h:e(h[5]),m:e(h[6]),s:e(h[7]),w:e(h[8])}),d=new g(f),db.isDuration(a)&&a.hasOwnProperty("_lang")&&(d._lang=a._lang),d},db.version=fb,db.defaultFormat=Nb,db.updateOffset=function(){},db.lang=function(a,b){var c;return a?(b?A(y(a),b):null===b?(B(a),a="en"):pb[a]||C(a),c=db.duration.fn._lang=db.fn._lang=C(a),c._abbr):db.fn._lang._abbr},db.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),C(a)},db.isMoment=function(a){return a instanceof f||null!=a&&a.hasOwnProperty("_isAMomentObject")},db.isDuration=function(a){return a instanceof g},eb=Zb.length-1;eb>=0;--eb)r(Zb[eb]);for(db.normalizeUnits=function(a){return p(a)},db.invalid=function(a){var b=db.utc(0/0);return null!=a?h(b._pf,a):b._pf.userInvalidated=!0,b},db.parseZone=function(a){return db(a).parseZone()},h(db.fn=f.prototype,{clone:function(){return db(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=db(this).utc();return 0<a.year()&&a.year()<=9999?F(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):F(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds()]},isValid:function(){return x(this)},isDSTShifted:function(){return this._a?this.isValid()&&o(this._a,(this._isUTC?db.utc(this._a):db(this._a)).toArray())>0:!1},parsingFlags:function(){return h({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(a){var b=F(this,a||db.defaultFormat);return this.lang().postformat(b)},add:function(a,b){var c;return c="string"==typeof a?db.duration(+b,a):db.duration(a,b),l(this,c,1),this},subtract:function(a,b){var c;return c="string"==typeof a?db.duration(+b,a):db.duration(a,b),l(this,c,-1),this},diff:function(a,b,c){var d,e,f=z(a,this),g=6e4*(this.zone()-f.zone());return b=p(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+f.daysInMonth()),e=12*(this.year()-f.year())+(this.month()-f.month()),e+=(this-db(this).startOf("month")-(f-db(f).startOf("month")))/d,e-=6e4*(this.zone()-db(this).startOf("month").zone()-(f.zone()-db(f).startOf("month").zone()))/d,"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:j(e)},from:function(a,b){return db.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(db(),a)},calendar:function(){var a=z(db(),this).startOf("day"),b=this.diff(a,"days",!0),c=-6>b?"sameElse":-1>b?"lastWeek":0>b?"lastDay":1>b?"sameDay":2>b?"nextDay":7>b?"nextWeek":"sameElse";return this.format(this.lang().calendar(c,this))},isLeapYear:function(){return v(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=V(a,this.lang()),this.add({d:a-b})):b},month:function(a){var b,c=this._isUTC?"UTC":"";return null!=a?"string"==typeof a&&(a=this.lang().monthsParse(a),"number"!=typeof a)?this:(b=this.date(),this.date(1),this._d["set"+c+"Month"](a),this.date(Math.min(b,this.daysInMonth())),db.updateOffset(this),this):this._d["get"+c+"Month"]()},startOf:function(a){switch(a=p(a)){case"year":this.month(0);case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1),this},endOf:function(a){return a=p(a),this.startOf(a).add("isoWeek"===a?"week":a,1).subtract("ms",1)},isAfter:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)>+db(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+db(a).startOf(b)},isSame:function(a,b){return b=b||"ms",+this.clone().startOf(b)===+z(a,this).startOf(b)},min:function(a){return a=db.apply(null,arguments),this>a?this:a},max:function(a){return a=db.apply(null,arguments),a>this?this:a},zone:function(a){var b=this._offset||0;return null==a?this._isUTC?b:this._d.getTimezoneOffset():("string"==typeof a&&(a=I(a)),Math.abs(a)<16&&(a=60*a),this._offset=a,this._isUTC=!0,b!==a&&l(this,db.duration(b-a,"m"),1,!0),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?db(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return t(this.year(),this.month())},dayOfYear:function(a){var b=hb((db(this).startOf("day")-db(this).startOf("year"))/864e5)+1;return null==a?b:this.add("d",a-b)},quarter:function(){return Math.ceil((this.month()+1)/3)},weekYear:function(a){var b=Y(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=Y(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=Y(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},get:function(a){return a=p(a),this[a]()},set:function(a,b){return a=p(a),"function"==typeof this[a]&&this[a](b),this},lang:function(b){return b===a?this._lang:(this._lang=C(b),this)}}),eb=0;eb<Rb.length;eb++)_(Rb[eb].toLowerCase().replace(/s$/,""),Rb[eb]);_("year","FullYear"),db.fn.days=db.fn.day,db.fn.months=db.fn.month,db.fn.weeks=db.fn.week,db.fn.isoWeeks=db.fn.isoWeek,db.fn.toJSON=db.fn.toISOString,h(db.duration.fn=g.prototype,{_bubble:function(){var a,b,c,d,e=this._milliseconds,f=this._days,g=this._months,h=this._data;h.milliseconds=e%1e3,a=j(e/1e3),h.seconds=a%60,b=j(a/60),h.minutes=b%60,c=j(b/60),h.hours=c%24,f+=j(c/24),h.days=f%30,g+=j(f/30),h.months=g%12,d=j(g/12),h.years=d},weeks:function(){return j(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*s(this._months/12)},humanize:function(a){var b=+this,c=X(b,!a,this.lang());return a&&(c=this.lang().pastFuture(b,c)),this.lang().postformat(c)},add:function(a,b){var c=db.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=db.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=p(a),this[a.toLowerCase()+"s"]()},as:function(a){return a=p(a),this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:db.fn.lang,toIsoString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"}});for(eb in Sb)Sb.hasOwnProperty(eb)&&(bb(eb,Sb[eb]),ab(eb.toLowerCase()));bb("Weeks",6048e5),db.duration.fn.asMonths=function(){return(+this-31536e6*this.years())/2592e6+12*this.years()},db.lang("en",{ordinal:function(a){var b=a%10,c=1===s(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),rb?(module.exports=db,cb(!0)):"function"==typeof define&&define.amd?define("moment",function(b,c,d){return d.config&&d.config()&&d.config().noGlobal!==!0&&cb(d.config().noGlobal===a),db}):cb()}).call(this);
1
  //! moment.js
2
+ //! version : 2.22.2
 
3
  //! license : MIT
4
  //! momentjs.com
5
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,"toString")&&(e.toString=t.toString),m(t,"valueOf")&&(e.valueOf=t.valueOf),e}function y(e,t,n,s){return Ot(e,t,n,s,!0).utc()}function g(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function p(e){if(null==e._isValid){var t=g(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function v(e){var t=y(NaN);return null!=e?_(g(t),e):g(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var r=c.momentProperties=[];function w(e,t){var n,s,i;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),0<r.length)for(n=0;n<r.length;n++)l(i=t[s=r[n]])||(e[s]=i);return e}var t=!1;function M(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,c.updateOffset(this),t=!1)}function S(e){return e instanceof M||null!=e&&null!=e._isAMomentObject}function D(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=D(t)),n}function a(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&k(e[s])!==k(t[s]))&&a++;return a+r}function Y(e){!1===c.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return _(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e="","object"==typeof arguments[n]){for(var s in e+="\n["+n+"] ",arguments[0])e+=s+": "+arguments[0][s]+", ";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}Y(i+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var s,O={};function T(e,t){null!=c.deprecationHandler&&c.deprecationHandler(e,t),O[e]||(Y(t),O[e]=!0)}function x(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function b(e,t){var n,s=_({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},_(s[n],e[n]),_(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=_({},s[n]));return s}function P(e){null!=e&&this.set(e)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};var W={};function H(e,t){var n=e.toLowerCase();W[n]=W[n+"s"]=W[t]=e}function R(e){return"string"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function C(e){var t,n,s={};for(n in e)m(e,n)&&(t=R(n))&&(s[t]=e[n]);return s}var F={};function L(e,t){F[e]=t}function U(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,G=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},E={};function I(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(E[e]=i),t&&(E[t[0]]=function(){return U(i.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=j(t,e.localeData()),V[t]=V[t]||function(s){var e,i,t,r=s.match(N);for(e=0,i=r.length;e<i;e++)E[r[e]]?r[e]=E[r[e]]:r[e]=(t=r[e]).match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"");return function(e){var t,n="";for(t=0;t<i;t++)n+=x(r[t])?r[t].call(e,s):r[t];return n}}(t),V[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(G.lastIndex=0;0<=n&&G.test(e);)e=e.replace(G,s),G.lastIndex=0,n-=1;return e}var Z=/\d/,z=/\d\d/,$=/\d{3}/,q=/\d{4}/,J=/[+-]?\d{6}/,B=/\d\d?/,Q=/\d\d\d\d?/,X=/\d\d\d\d\d\d?/,K=/\d{1,3}/,ee=/\d{1,4}/,te=/[+-]?\d{1,6}/,ne=/\d+/,se=/[+-]?\d+/,ie=/Z|[+-]\d\d:?\d\d/gi,re=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,oe={};function ue(e,n,s){oe[e]=x(n)?n:function(e,t){return e&&s?s:n}}function le(e,t){return m(oe,e)?oe[e](t._strict,t._locale):new RegExp(de(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function de(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var he={};function ce(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),d(n)&&(s=function(e,t){t[n]=k(e)}),t=0;t<e.length;t++)he[e[t]]=s}function fe(e,i){ce(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var me=0,_e=1,ye=2,ge=3,pe=4,ve=5,we=6,Me=7,Se=8;function De(e){return ke(e)?366:365}function ke(e){return e%4==0&&e%100!=0||e%400==0}I("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),H("year","y"),L("year",1),ue("Y",se),ue("YY",B,z),ue("YYYY",ee,q),ue("YYYYY",te,J),ue("YYYYYY",te,J),ce(["YYYYY","YYYYYY"],me),ce("YYYY",function(e,t){t[me]=2===e.length?c.parseTwoDigitYear(e):k(e)}),ce("YY",function(e,t){t[me]=c.parseTwoDigitYear(e)}),ce("Y",function(e,t){t[me]=parseInt(e,10)}),c.parseTwoDigitYear=function(e){return k(e)+(68<k(e)?1900:2e3)};var Ye,Oe=Te("FullYear",!0);function Te(t,n){return function(e){return null!=e?(be(this,t,e),c.updateOffset(this,n),this):xe(this,t)}}function xe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function be(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&ke(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Pe(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?ke(e)?29:28:31-s%7%2}Ye=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),H("month","M"),L("month",8),ue("M",B),ue("MM",B,z),ue("MMM",function(e,t){return t.monthsShortRegex(e)}),ue("MMMM",function(e,t){return t.monthsRegex(e)}),ce(["M","MM"],function(e,t){t[_e]=k(e)-1}),ce(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[_e]=i:g(n).invalidMonth=e});var We=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,He="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Re="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Ce(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!d(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Pe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Fe(e){return null!=e?(Ce(this,e),c.updateOffset(this,!0),this):xe(this,"Month")}var Le=ae;var Ue=ae;function Ne(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=y([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=de(s[t]),i[t]=de(i[t]);for(t=0;t<24;t++)r[t]=de(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ge(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&0<=e&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ve(e,t,n){var s=7+t-n;return-((7+Ge(e,0,s).getUTCDay()-t)%7)+s-1}function Ee(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ve(e,s,i);return o<=0?a=De(r=e-1)+o:o>De(e)?(r=e+1,a=o-De(e)):(r=e,a=o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(De(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),H("week","w"),H("isoWeek","W"),L("week",5),L("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=k(e)});I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),H("day","d"),H("weekday","e"),H("isoWeekday","E"),L("day",11),L("weekday",11),L("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=k(e)});var je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var $e=ae;var qe=ae;var Je=ae;function Be(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=de(o[t]),u[t]=de(u[t]),l[t]=de(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Xe(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ke(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Qe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+U(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Xe("a",!0),Xe("A",!1),H("hour","h"),L("hour",13),ue("a",Ke),ue("A",Ke),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=k(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=k(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i))});var et,tt=Te("Hours",!0),nt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:He,monthsShort:Re,week:{dow:0,doy:6},weekdays:je,weekdaysMin:ze,weekdaysShort:Ze,meridiemParse:/[ap]\.?m?\.?/i},st={},it={};function rt(e){return e?e.toLowerCase().replace("_","-"):e}function at(e){var t=null;if(!st[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=et._abbr,require("./locale/"+e),ot(t)}catch(e){}return st[e]}function ot(e,t){var n;return e&&((n=l(t)?lt(e):ut(e,t))?et=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),et._abbr}function ut(e,t){if(null!==t){var n,s=nt;if(t.abbr=e,null!=st[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=st[e]._config;else if(null!=t.parentLocale)if(null!=st[t.parentLocale])s=st[t.parentLocale]._config;else{if(null==(n=at(t.parentLocale)))return it[t.parentLocale]||(it[t.parentLocale]=[]),it[t.parentLocale].push({name:e,config:t}),null;s=n._config}return st[e]=new P(b(s,t)),it[e]&&it[e].forEach(function(e){ut(e.name,e.config)}),ot(e),st[e]}return delete st[e],null}function lt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return et;if(!o(e)){if(t=at(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=rt(e[r]).split("-")).length,n=(n=rt(e[r+1]))?n.split("-"):null;0<t;){if(s=at(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&a(i,n,!0)>=t-1)break;t--}r++}return et}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11<n[_e]?_e:n[ye]<1||n[ye]>Pe(n[me],n[_e])?ye:n[ge]<0||24<n[ge]||24===n[ge]&&(0!==n[pe]||0!==n[ve]||0!==n[we])?ge:n[pe]<0||59<n[pe]?pe:n[ve]<0||59<n[ve]?ve:n[we]<0||999<n[we]?we:-1,g(e)._overflowDayOfYear&&(t<me||ye<t)&&(t=ye),g(e)._overflowWeeks&&-1===t&&(t=Me),g(e)._overflowWeekday&&-1===t&&(t=Se),g(e).overflow=t),e}function ht(e,t,n){return null!=e?e:null!=t?t:n}function ct(e){var t,n,s,i,r,a=[];if(!e._d){var o,u;for(o=e,u=new Date(c.now()),s=o._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()],e._w&&null==e._a[ye]&&null==e._a[_e]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ht(t.GG,e._a[me],Ie(Tt(),1,4).year),s=ht(t.W,1),((i=ht(t.E,1))<1||7<i)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ie(Tt(),r,a);n=ht(t.gg,e._a[me],l.year),s=ht(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r}s<1||s>Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ht(e._a[me],s[me]),(e._dayOfYear>De(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[pe]&&0===e._a[ve]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&0<=e&&isFinite(o.getFullYear())&&o.setFullYear(e),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var ft=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,mt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],gt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pt=/^\/?Date\((\-?\d+)/i;function vt(e){var t,n,s,i,r,a,o=e._i,u=ft.exec(o)||mt.exec(o);if(u){for(g(e).iso=!0,t=0,n=yt.length;t<n;t++)if(yt[t][1].exec(u[1])){i=yt[t][0],s=!1!==yt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[3])){r=(u[2]||" ")+gt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!_t.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),kt(e)}else e._isValid=!1}var wt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function Mt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Re.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Dt(e){var t,n,s,i=wt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(i){var r=Mt(i[4],i[3],i[2],i[5],i[6],i[7]);if(t=i[1],n=r,s=e,t&&Ze.indexOf(t)!==new Date(n[0],n[1],n[2]).getDay()&&(g(s).weekdayMismatch=!0,!(s._isValid=!1)))return;e._a=r,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(i[8],i[9],i[10]),e._d=Ge.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function kt(e){if(e._f!==c.ISO_8601)if(e._f!==c.RFC_2822){e._a=[],g(e).empty=!0;var t,n,s,i,r,a,o,u,l=""+e._i,d=l.length,h=0;for(s=j(e._f,e._locale).match(N)||[],t=0;t<s.length;t++)i=s[t],(n=(l.match(le(i,e))||[])[0])&&(0<(r=l.substr(0,l.indexOf(n))).length&&g(e).unusedInput.push(r),l=l.slice(l.indexOf(n)+n.length),h+=n.length),E[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),a=i,u=e,null!=(o=n)&&m(he,a)&&he[a](o,u._a,u,a)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=d-h,0<l.length&&g(e).unusedInput.push(l),e._a[ge]<=12&&!0===g(e).bigHour&&0<e._a[ge]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[ge]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[ge],e._meridiem),ct(e),dt(e)}else Dt(e);else vt(e)}function Yt(e){var t,n,s,i,r=e._i,a=e._f;return e._locale=e._locale||lt(e._l),null===r||void 0===a&&""===r?v({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),S(r)?new M(dt(r)):(h(r)?e._d=r:o(a)?function(e){var t,n,s,i,r;if(0===e._f.length)return g(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],kt(t),p(t)&&(r+=g(t).charsLeftOver,r+=10*g(t).unusedTokens.length,g(t).score=r,(null==s||r<s)&&(s=r,n=t));_(e,n||t)}(e):a?kt(e):l(n=(t=e)._i)?t._d=new Date(c.now()):h(n)?t._d=new Date(n.valueOf()):"string"==typeof n?(s=t,null===(i=pt.exec(s._i))?(vt(s),!1===s._isValid&&(delete s._isValid,Dt(s),!1===s._isValid&&(delete s._isValid,c.createFromInputFallback(s)))):s._d=new Date(+i[1])):o(n)?(t._a=f(n.slice(0),function(e){return parseInt(e,10)}),ct(t)):u(n)?function(e){if(!e._d){var t=C(e._i);e._a=f([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ct(e)}}(t):d(n)?t._d=new Date(n):c.createFromInputFallback(t),p(e)||(e._d=null),e))}function Ot(e,t,n,s,i){var r,a={};return!0!==n&&!1!==n||(s=n,n=void 0),(u(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new M(dt(Yt(a))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function Tt(e,t,n,s){return Ot(e,t,n,s,!1)}c.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),c.ISO_8601=function(){},c.RFC_2822=function(){};var xt=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:v()}),bt=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:v()});function Pt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Tt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Wt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ht(e){var t=C(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,d=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ye.call(Wt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<Wt.length;++s)if(e[Wt[s]]){if(n)return!1;parseFloat(e[Wt[s]])!==k(e[Wt[s]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=lt(),this._bubble()}function Rt(e){return e instanceof Ht}function Ct(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){I(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+U(~~(e/60),2)+n+U(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),ue("Z",re),ue("ZZ",re),ce(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ut(re,e)});var Lt=/([\+\-]|\d\d)/gi;function Ut(e,t){var n=(t||"").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+"").match(Lt)||["-",0,0],i=60*s[1]+k(s[2]);return 0===i?0:"+"===s[0]?i:-i}function Nt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(S(e)||h(e)?e.valueOf():Tt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),c.updateOffset(n,!1),n):Tt(e).local()}function Gt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Vt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var Et=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,It=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function At(e,t){var n,s,i,r=e,a=null;return Rt(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(r={},t?r[t]=e:r.milliseconds=e):(a=Et.exec(e))?(n="-"===a[1]?-1:1,r={y:0,d:k(a[ye])*n,h:k(a[ge])*n,m:k(a[pe])*n,s:k(a[ve])*n,ms:k(Ct(1e3*a[we]))*n}):(a=It.exec(e))?(n="-"===a[1]?-1:(a[1],1),r={y:jt(a[2],n),M:jt(a[3],n),w:jt(a[4],n),d:jt(a[5],n),h:jt(a[6],n),m:jt(a[7],n),s:jt(a[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Nt(t,e),e.isBefore(t)?n=Zt(e,t):((n=Zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Tt(r.from),Tt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ht(r),Rt(e)&&m(e,"_locale")&&(s._locale=e._locale),s}function jt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Zt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function zt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(T(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),$t(this,At(e="string"==typeof e?+e:e,t),s),this}}function $t(e,t,n,s){var i=t._milliseconds,r=Ct(t._days),a=Ct(t._months);e.isValid()&&(s=null==s||s,a&&Ce(e,xe(e,"Month")+a*n),r&&be(e,"Date",xe(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&c.updateOffset(e,r||a))}At.fn=Ht.prototype,At.invalid=function(){return At(NaN)};var qt=zt(1,"add"),Jt=zt(-1,"subtract");function Bt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(n+1,"months")-s)))||0}function Qt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=lt(e))&&(this._locale=t),this)}c.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",c.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Xt=n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function Kt(){return this._locale}function en(e,t){I(0,[e,e.length],0,t)}function tn(e,t,n,s,i){var r;return null==e?Ie(this,s,i).year:((r=Ae(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ge(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),en("gggg","weekYear"),en("ggggg","weekYear"),en("GGGG","isoWeekYear"),en("GGGGG","isoWeekYear"),H("weekYear","gg"),H("isoWeekYear","GG"),L("weekYear",1),L("isoWeekYear",1),ue("G",se),ue("g",se),ue("GG",B,z),ue("gg",B,z),ue("GGGG",ee,q),ue("gggg",ee,q),ue("GGGGG",te,J),ue("ggggg",te,J),fe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=k(e)}),fe(["gg","GG"],function(e,t,n,s){t[s]=c.parseTwoDigitYear(e)}),I("Q",0,"Qo","quarter"),H("quarter","Q"),L("quarter",7),ue("Q",Z),ce("Q",function(e,t){t[_e]=3*(k(e)-1)}),I("D",["DD",2],"Do","date"),H("date","D"),L("date",9),ue("D",B),ue("DD",B,z),ue("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce(["D","DD"],ye),ce("Do",function(e,t){t[ye]=k(e.match(B)[0])});var nn=Te("Date",!0);I("DDD",["DDDD",3],"DDDo","dayOfYear"),H("dayOfYear","DDD"),L("dayOfYear",4),ue("DDD",K),ue("DDDD",$),ce(["DDD","DDDD"],function(e,t,n){n._dayOfYear=k(e)}),I("m",["mm",2],0,"minute"),H("minute","m"),L("minute",14),ue("m",B),ue("mm",B,z),ce(["m","mm"],pe);var sn=Te("Minutes",!1);I("s",["ss",2],0,"second"),H("second","s"),L("second",15),ue("s",B),ue("ss",B,z),ce(["s","ss"],ve);var rn,an=Te("Seconds",!1);for(I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),H("millisecond","ms"),L("millisecond",16),ue("S",K,Z),ue("SS",K,z),ue("SSS",K,$),rn="SSSS";rn.length<=9;rn+="S")ue(rn,ne);function on(e,t){t[we]=k(1e3*("0."+e))}for(rn="S";rn.length<=9;rn+="S")ce(rn,on);var un=Te("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var ln=M.prototype;function dn(e){return e}ln.add=qt,ln.calendar=function(e,t){var n=e||Tt(),s=Nt(n,this).startOf("day"),i=c.calendarFormat(this,s)||"sameElse",r=t&&(x(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,Tt(n)))},ln.clone=function(){return new M(this)},ln.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Nt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=R(t)){case"year":r=Bt(this,s)/12;break;case"month":r=Bt(this,s);break;case"quarter":r=Bt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:D(r)},ln.endOf=function(e){return void 0===(e=R(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},ln.format=function(e){e||(e=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},ln.from=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.fromNow=function(e){return this.from(Tt(),e)},ln.to=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.toNow=function(e){return this.to(Tt(),e)},ln.get=function(e){return x(this[e=R(e)])?this[e]():this},ln.invalidAt=function(){return g(this).overflow},ln.isAfter=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=R(l(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},ln.isBefore=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=R(l(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},ln.isBetween=function(e,t,n,s){return("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},ln.isSame=function(e,t){var n,s=S(e)?e:Tt(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=R(t||"millisecond"))?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},ln.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},ln.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},ln.isValid=function(){return p(this)},ln.lang=Xt,ln.locale=Qt,ln.localeData=Kt,ln.max=bt,ln.min=xt,ln.parsingFlags=function(){return _({},g(this))},ln.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:F[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=C(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(x(this[e=R(e)]))return this[e](t);return this},ln.startOf=function(e){switch(e=R(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},ln.subtract=Jt,ln.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},ln.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},ln.toDate=function(){return new Date(this.valueOf())},ln.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?A(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):x(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",A(n,"Z")):A(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},ln.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+s+"-MM-DD[T]HH:mm:ss.SSS"+i)},ln.toJSON=function(){return this.isValid()?this.toISOString():null},ln.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},ln.unix=function(){return Math.floor(this.valueOf()/1e3)},ln.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},ln.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},ln.year=Oe,ln.isLeapYear=function(){return ke(this.year())},ln.weekYear=function(e){return tn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},ln.isoWeekYear=function(e){return tn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},ln.quarter=ln.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},ln.month=Fe,ln.daysInMonth=function(){return Pe(this.year(),this.month())},ln.week=ln.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},ln.isoWeek=ln.isoWeeks=function(e){var t=Ie(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},ln.weeksInYear=function(){var e=this.localeData()._week;return Ae(this.year(),e.dow,e.doy)},ln.isoWeeksInYear=function(){return Ae(this.year(),1,4)},ln.date=nn,ln.day=ln.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},ln.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},ln.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=(n=e,s=this.localeData(),"string"==typeof n?s.weekdaysParse(n)%7||7:isNaN(n)?null:n);return this.day(this.day()%7?t:t-7)}return this.day()||7;var n,s},ln.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},ln.hour=ln.hours=tt,ln.minute=ln.minutes=sn,ln.second=ln.seconds=an,ln.millisecond=ln.milliseconds=un,ln.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Ut(re,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Gt(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?$t(this,At(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Gt(this)},ln.utc=function(e){return this.utcOffset(0,e)},ln.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Gt(this),"m")),this},ln.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Ut(ie,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},ln.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Tt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},ln.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Vt,ln.isUTC=Vt,ln.zoneAbbr=function(){return this._isUTC?"UTC":""},ln.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ln.dates=n("dates accessor is deprecated. Use date instead.",nn),ln.months=n("months accessor is deprecated. Use month instead",Fe),ln.years=n("years accessor is deprecated. Use year instead",Oe),ln.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),ln.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Yt(e))._a){var t=e._isUTC?y(e._a):Tt(e._a);this._isDSTShifted=this.isValid()&&0<a(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var hn=P.prototype;function cn(e,t,n,s){var i=lt(),r=y().set(s,t);return i[n](r,e)}function fn(e,t,n){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=cn(e,s,n,"month");return i}function mn(e,t,n,s){"boolean"==typeof e?d(t)&&(n=t,t=void 0):(t=e,e=!1,d(n=t)&&(n=t,t=void 0)),t=t||"";var i,r=lt(),a=e?r._week.dow:0;if(null!=n)return cn(t,(n+a)%7,s,"day");var o=[];for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,"day");return o}hn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return x(s)?s.call(t,n):s},hn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},hn.invalidDate=function(){return this._invalidDate},hn.ordinal=function(e){return this._ordinal.replace("%d",e)},hn.preparse=dn,hn.postformat=dn,hn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return x(i)?i(e,t,n,s):i.replace(/%d/i,e)},hn.pastFuture=function(e,t){var n=this._relativeTime[0<e?"future":"past"];return x(n)?n(t):n.replace(/%s/i,t)},hn.set=function(e){var t,n;for(n in e)x(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},hn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||We).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},hn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[We.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},hn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=y([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=y([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},hn.monthsRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,"_monthsRegex")||(this._monthsRegex=Ue),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},hn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,"_monthsShortRegex")||(this._monthsShortRegex=Le),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},hn.week=function(e){return Ie(e,this._week.dow,this._week.doy).week},hn.firstDayOfYear=function(){return this._week.doy},hn.firstDayOfWeek=function(){return this._week.dow},hn.weekdays=function(e,t){return e?o(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:o(this._weekdays)?this._weekdays:this._weekdays.standalone},hn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},hn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},hn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=y([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=y([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},hn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=$e),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},hn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=qe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},hn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Je),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},hn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},hn.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ot("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===k(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),c.lang=n("moment.lang is deprecated. Use moment.locale instead.",ot),c.langData=n("moment.langData is deprecated. Use moment.localeData instead.",lt);var _n=Math.abs;function yn(e,t,n,s){var i=At(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function pn(e){return 4800*e/146097}function vn(e){return 146097*e/4800}function wn(e){return function(){return this.as(e)}}var Mn=wn("ms"),Sn=wn("s"),Dn=wn("m"),kn=wn("h"),Yn=wn("d"),On=wn("w"),Tn=wn("M"),xn=wn("y");function bn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Pn=bn("milliseconds"),Wn=bn("seconds"),Hn=bn("minutes"),Rn=bn("hours"),Cn=bn("days"),Fn=bn("months"),Ln=bn("years");var Un=Math.round,Nn={ss:44,s:45,m:45,h:22,d:26,M:11};var Gn=Math.abs;function Vn(e){return(0<e)-(e<0)||+e}function En(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Gn(this._milliseconds)/1e3,s=Gn(this._days),i=Gn(this._months);t=D((e=D(n/60))/60),n%=60,e%=60;var r=D(i/12),a=i%=12,o=s,u=t,l=e,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=Vn(this._months)!==Vn(h)?"-":"",m=Vn(this._days)!==Vn(h)?"-":"",_=Vn(this._milliseconds)!==Vn(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(a?f+a+"M":"")+(o?m+o+"D":"")+(u||l||d?"T":"")+(u?_+u+"H":"")+(l?_+l+"M":"")+(d?_+d+"S":"")}var In=Ht.prototype;return In.isValid=function(){return this._isValid},In.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},In.add=function(e,t){return yn(this,e,t,1)},In.subtract=function(e,t){return yn(this,e,t,-1)},In.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=R(e))||"year"===e)return t=this._days+s/864e5,n=this._months+pn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(vn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},In.asMilliseconds=Mn,In.asSeconds=Sn,In.asMinutes=Dn,In.asHours=kn,In.asDays=Yn,In.asWeeks=On,In.asMonths=Tn,In.asYears=xn,In.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},In._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*gn(vn(o)+a),o=a=0),u.milliseconds=r%1e3,e=D(r/1e3),u.seconds=e%60,t=D(e/60),u.minutes=t%60,n=D(t/60),u.hours=n%24,o+=i=D(pn(a+=D(n/24))),a-=gn(vn(i)),s=D(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},In.clone=function(){return At(this)},In.get=function(e){return e=R(e),this.isValid()?this[e+"s"]():NaN},In.milliseconds=Pn,In.seconds=Wn,In.minutes=Hn,In.hours=Rn,In.days=Cn,In.weeks=function(){return D(this.days()/7)},In.months=Fn,In.years=Ln,In.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t,n,s,i,r,a,o,u,l,d,h,c=this.localeData(),f=(n=!e,s=c,i=At(t=this).abs(),r=Un(i.as("s")),a=Un(i.as("m")),o=Un(i.as("h")),u=Un(i.as("d")),l=Un(i.as("M")),d=Un(i.as("y")),(h=r<=Nn.ss&&["s",r]||r<Nn.s&&["ss",r]||a<=1&&["m"]||a<Nn.m&&["mm",a]||o<=1&&["h"]||o<Nn.h&&["hh",o]||u<=1&&["d"]||u<Nn.d&&["dd",u]||l<=1&&["M"]||l<Nn.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=n,h[3]=0<+t,h[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,h));return e&&(f=c.pastFuture(+this,f)),c.postformat(f)},In.toISOString=En,In.toString=En,In.toJSON=En,In.locale=Qt,In.localeData=Kt,In.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",En),In.lang=Xt,I("X",0,0,"unix"),I("x",0,0,"valueOf"),ue("x",se),ue("X",/[+-]?\d+(\.\d{1,3})?/),ce("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ce("x",function(e,t,n){n._d=new Date(k(e))}),c.version="2.22.2",e=Tt,c.fn=ln,c.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},c.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=y,c.unix=function(e){return Tt(1e3*e)},c.months=function(e,t){return fn(e,t,"months")},c.isDate=h,c.locale=ot,c.invalid=v,c.duration=At,c.isMoment=S,c.weekdays=function(e,t,n){return mn(e,t,n,"weekdays")},c.parseZone=function(){return Tt.apply(null,arguments).parseZone()},c.localeData=lt,c.isDuration=Rt,c.monthsShort=function(e,t){return fn(e,t,"monthsShort")},c.weekdaysMin=function(e,t,n){return mn(e,t,n,"weekdaysMin")},c.defineLocale=ut,c.updateLocale=function(e,t){if(null!=t){var n,s,i=nt;null!=(s=at(e))&&(i=s._config),(n=new P(t=b(i,t))).parentLocale=st[e],st[e]=n,ot(e)}else null!=st[e]&&(null!=st[e].parentLocale?st[e]=st[e].parentLocale:null!=st[e]&&delete st[e]);return st[e]},c.locales=function(){return s(st)},c.weekdaysShort=function(e,t,n){return mn(e,t,n,"weekdaysShort")},c.normalizeUnits=R,c.relativeTimeRounding=function(e){return void 0===e?Un:"function"==typeof e&&(Un=e,!0)},c.relativeTimeThreshold=function(e,t){return void 0!==Nn[e]&&(void 0===t?Nn[e]:(Nn[e]=t,"s"===e&&(Nn.ss=t-1),!0))},c.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},c.prototype=ln,c.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},c});
assets/gmedia.global.front.css ADDED
@@ -0,0 +1 @@
 
1
+ .mfp-gmedia-open .mfp-arrow { top: auto !important; margin-top: auto !important; }
config/setup.php CHANGED
@@ -91,6 +91,8 @@ function gmedia_default_options(){
91
  $gm['license_key'] = '';
92
  $gm['license_key2'] = '';
93
 
 
 
94
  $gm['taxonomies']['gmedia_category'] = array();
95
  $gm['taxonomies']['gmedia_tag'] = array();
96
  $gm['taxonomies']['gmedia_album'] = array();
91
  $gm['license_key'] = '';
92
  $gm['license_key2'] = '';
93
 
94
+ $gm['google_api_key'] = '';
95
+
96
  $gm['taxonomies']['gmedia_category'] = array();
97
  $gm['taxonomies']['gmedia_tag'] = array();
98
  $gm['taxonomies']['gmedia_album'] = array();
grand-media.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Gmedia Gallery
4
  * Plugin URI: http://wordpress.org/extend/plugins/grand-media/
5
  * Description: Gmedia Gallery - powerful media library plugin for creating beautiful galleries and managing files.
6
- * Version: 1.12.4
7
  * Author: Rattus
8
  * Author URI: https://codeasily.com/
9
  * Requires at least: 3.7
@@ -42,7 +42,7 @@ if( !class_exists('Gmedia')){
42
  */
43
  class Gmedia {
44
 
45
- var $version = '1.12.4';
46
  var $dbversion = '1.8.0';
47
  var $minium_WP = '3.7';
48
  var $options = '';
@@ -343,16 +343,17 @@ if( !class_exists('Gmedia')){
343
  function register_scripts_backend(){
344
  global $gmCore;
345
 
346
- wp_register_script('gmedia-global-backend', $gmCore->gmedia_url . '/admin/assets/js/gmedia.global.js', array('jquery'), '1.8.26');
347
  wp_localize_script('gmedia-global-backend', 'GmediaGallery', array(
348
  'ajaxurl' => admin_url('admin-ajax.php'),
349
  '_wpnonce' => wp_create_nonce('GmediaGallery'),
350
  'upload_dirurl' => $gmCore->upload['url'],
351
- 'plugin_dirurl' => $gmCore->gmedia_url
 
352
  ));
353
 
354
- wp_register_style('grand-media', $gmCore->gmedia_url . '/admin/assets/css/gmedia.admin.css', array(), '1.12.0', 'all');
355
- wp_register_script('grand-media', $gmCore->gmedia_url . '/admin/assets/js/gmedia.admin.js', array('jquery', 'gmedia-global-backend'), '1.12.0');
356
  wp_localize_script('grand-media', 'grandMedia', array(
357
  'error3' => __('Disable your Popup Blocker and try again.', 'grand-media'),
358
  'download' => __('downloading...', 'grand-media'),
@@ -370,14 +371,16 @@ if( !class_exists('Gmedia')){
370
  function register_scripts_frontend(){
371
  global $gmCore, $wp_scripts, $wp;
372
 
373
- wp_register_script('gmedia-global-frontend', $gmCore->gmedia_url . '/assets/gmedia.global.front.js', array('jquery'), '1.9.16');
 
374
  wp_localize_script('gmedia-global-frontend', 'GmediaGallery', array(
375
  'ajaxurl' => admin_url('admin-ajax.php'),
376
  'nonce' => wp_create_nonce('GmediaGallery'),
377
  'upload_dirurl' => $gmCore->upload['url'],
378
  'plugin_dirurl' => $gmCore->upload['url'],
379
  'license' => strtolower($this->options['license_key']),
380
- 'license2' => $this->options['license_key2']
 
381
  ));
382
 
383
 
@@ -447,6 +450,7 @@ if( !class_exists('Gmedia')){
447
 
448
  function load_scripts(){
449
  wp_enqueue_script('jquery');
 
450
  wp_enqueue_script('gmedia-global-frontend');
451
  }
452
 
@@ -457,6 +461,7 @@ if( !class_exists('Gmedia')){
457
  foreach($this->do_module as $m => $module){
458
  $deps = array_merge($deps, explode(',', $module['info']['dependencies']));
459
  $deps = apply_filters('gmedia_module_js_dependencies', $deps, $m);
 
460
  foreach($deps as $handle){
461
  if(wp_script_is($handle, 'registered')){
462
  wp_enqueue_script($handle, $_src = false, $_deps = array('jquery'), $this->version, $_in_footer = true);
@@ -479,10 +484,11 @@ if( !class_exists('Gmedia')){
479
  $files = glob($module['path'] . '/js/*.js', GLOB_NOSORT);
480
  if( !empty($files)){
481
  $files = array_map('basename', $files);
 
482
  foreach($files as $file){
483
  $_ver = isset($module['info']['version'])? $module['info']['version'] : false;
484
  $handle = "{$module['name']}_{$file}";
485
- wp_enqueue_script($handle, "{$module['url']}/js/{$file}", array('jquery'), $_ver, true);
486
  if($xmlhttprequest){
487
  wp_print_scripts($handle);
488
  }
3
  * Plugin Name: Gmedia Gallery
4
  * Plugin URI: http://wordpress.org/extend/plugins/grand-media/
5
  * Description: Gmedia Gallery - powerful media library plugin for creating beautiful galleries and managing files.
6
+ * Version: 1.13.2
7
  * Author: Rattus
8
  * Author URI: https://codeasily.com/
9
  * Requires at least: 3.7
42
  */
43
  class Gmedia {
44
 
45
+ var $version = '1.13.2';
46
  var $dbversion = '1.8.0';
47
  var $minium_WP = '3.7';
48
  var $options = '';
343
  function register_scripts_backend(){
344
  global $gmCore;
345
 
346
+ wp_register_script('gmedia-global-backend', $gmCore->gmedia_url . '/admin/assets/js/gmedia.global.js', array('jquery'), '1.13.0');
347
  wp_localize_script('gmedia-global-backend', 'GmediaGallery', array(
348
  'ajaxurl' => admin_url('admin-ajax.php'),
349
  '_wpnonce' => wp_create_nonce('GmediaGallery'),
350
  'upload_dirurl' => $gmCore->upload['url'],
351
+ 'plugin_dirurl' => $gmCore->gmedia_url,
352
+ 'google_api_key'=> $this->options['google_api_key']
353
  ));
354
 
355
+ wp_register_style('grand-media', $gmCore->gmedia_url . '/admin/assets/css/gmedia.admin.css', array(), '1.13.0', 'all');
356
+ wp_register_script('grand-media', $gmCore->gmedia_url . '/admin/assets/js/gmedia.admin.js', array('jquery', 'gmedia-global-backend'), '1.13.0');
357
  wp_localize_script('grand-media', 'grandMedia', array(
358
  'error3' => __('Disable your Popup Blocker and try again.', 'grand-media'),
359
  'download' => __('downloading...', 'grand-media'),
371
  function register_scripts_frontend(){
372
  global $gmCore, $wp_scripts, $wp;
373
 
374
+ wp_register_style('gmedia-global-frontend', $gmCore->gmedia_url . '/assets/gmedia.global.front.css', array(), '1.12.11');
375
+ wp_register_script('gmedia-global-frontend', $gmCore->gmedia_url . '/assets/gmedia.global.front.js', array('jquery'), '1.13.0');
376
  wp_localize_script('gmedia-global-frontend', 'GmediaGallery', array(
377
  'ajaxurl' => admin_url('admin-ajax.php'),
378
  'nonce' => wp_create_nonce('GmediaGallery'),
379
  'upload_dirurl' => $gmCore->upload['url'],
380
  'plugin_dirurl' => $gmCore->upload['url'],
381
  'license' => strtolower($this->options['license_key']),
382
+ 'license2' => $this->options['license_key2'],
383
+ 'google_api_key'=> $this->options['google_api_key']
384
  ));
385
 
386
 
450
 
451
  function load_scripts(){
452
  wp_enqueue_script('jquery');
453
+ wp_enqueue_style('gmedia-global-frontend');
454
  wp_enqueue_script('gmedia-global-frontend');
455
  }
456
 
461
  foreach($this->do_module as $m => $module){
462
  $deps = array_merge($deps, explode(',', $module['info']['dependencies']));
463
  $deps = apply_filters('gmedia_module_js_dependencies', $deps, $m);
464
+ $deps = array_filter(array_unique($deps));
465
  foreach($deps as $handle){
466
  if(wp_script_is($handle, 'registered')){
467
  wp_enqueue_script($handle, $_src = false, $_deps = array('jquery'), $this->version, $_in_footer = true);
484
  $files = glob($module['path'] . '/js/*.js', GLOB_NOSORT);
485
  if( !empty($files)){
486
  $files = array_map('basename', $files);
487
+ $files_deps = array_merge(array('jquery'), $deps);
488
  foreach($files as $file){
489
  $_ver = isset($module['info']['version'])? $module['info']['version'] : false;
490
  $handle = "{$module['name']}_{$file}";
491
+ wp_enqueue_script($handle, "{$module['url']}/js/{$file}", $files_deps, $_ver, true);
492
  if($xmlhttprequest){
493
  wp_print_scripts($handle);
494
  }
inc/core.php CHANGED
@@ -3667,32 +3667,38 @@ class GmediaCore {
3667
  */
3668
  function modules_order(){
3669
  return array(
3670
- 'albumsgrid' => '',
3671
- 'phantom-pro' => '',
3672
- 'albums-stripes' => '',
3673
- 'cubik' => '',
3674
- 'desire' => '',
3675
- 'phototravlr' => '',
3676
- 'realslider' => '',
3677
- 'mosaic' => '',
3678
- 'photobox' => '',
3679
- 'wavesurfer' => '',
3680
- 'phantom' => '',
3681
- 'flipgrid' => '',
3682
- 'cubik-lite' => '',
3683
- 'photomania' => '',
3684
- 'jq-mplayer' => '',
3685
- 'wp-videoplayer' => '',
3686
- 'photo-pro' => '',
3687
- 'optima' => '',
3688
- 'afflux' => '',
3689
- 'slider' => '',
3690
- 'green-style' => '',
3691
- 'photo-blog' => '',
3692
- 'minima' => '',
3693
- 'sphere' => '',
3694
- 'cube' => '',
3695
- 'flatwall' => ''
 
 
 
 
 
 
3696
  );
3697
  }
3698
 
3667
  */
3668
  function modules_order(){
3669
  return array(
3670
+ 'albumsListMasonry' => '',
3671
+ 'albumsList' => '',
3672
+ 'woowslider' => '',
3673
+ 'albums-switcher' => '',
3674
+ 'photocluster' => '',
3675
+ 'albumsview' => '',
3676
+ 'albumsgrid' => '',
3677
+ 'phantom-pro' => '',
3678
+ 'albums-stripes' => '',
3679
+ 'cubik' => '',
3680
+ 'desire' => '',
3681
+ 'phototravlr' => '',
3682
+ 'realslider' => '',
3683
+ 'mosaic' => '',
3684
+ 'photobox' => '',
3685
+ 'wavesurfer' => '',
3686
+ 'phantom' => '',
3687
+ 'flipgrid' => '',
3688
+ 'cubik-lite' => '',
3689
+ 'photomania' => '',
3690
+ 'jq-mplayer' => '',
3691
+ 'wp-videoplayer' => '',
3692
+ 'photo-pro' => '',
3693
+ 'optima' => '',
3694
+ 'afflux' => '',
3695
+ 'slider' => '',
3696
+ 'green-style' => '',
3697
+ 'photo-blog' => '',
3698
+ 'minima' => '',
3699
+ 'sphere' => '',
3700
+ 'cube' => '',
3701
+ 'flatwall' => ''
3702
  );
3703
  }
3704
 
inc/frontend.filters.php CHANGED
@@ -279,7 +279,7 @@ function gmedia_post_type__the_excerpt($content){
279
  * @return mixed|string
280
  */
281
  function gmedia_post_type__the_content($content){
282
- global $post, $gmDB, $gmCore;
283
 
284
  if('gmedia' !== substr($post->post_type, 0, 6)){
285
  return $content;
@@ -427,7 +427,7 @@ function gmedia_post_type__the_content($content){
427
  <div class="gmsingle_location_info">
428
  <a href='https://www.google.com/maps/place/<?php echo $loc; ?>'
429
  target='_blank'><img
430
- src='//maps.googleapis.com/maps/api/staticmap?key=AIzaSyBMiF6nlG5O1tE81Q-35_dckOwW4ypMRuk&size=320x240&zoom=10&scale=2&maptype=roadmap&markers=<?php echo $loc; ?>'
431
  alt='' width='320' height='240'/></a>
432
  </div>
433
  </div>
279
  * @return mixed|string
280
  */
281
  function gmedia_post_type__the_content($content){
282
+ global $post, $gmDB, $gmCore, $gmGallery;
283
 
284
  if('gmedia' !== substr($post->post_type, 0, 6)){
285
  return $content;
427
  <div class="gmsingle_location_info">
428
  <a href='https://www.google.com/maps/place/<?php echo $loc; ?>'
429
  target='_blank'><img
430
+ src='//maps.googleapis.com/maps/api/staticmap?key=<?php esc_attr_e($gmGallery->options['google_api_key']); ?>&size=320x240&zoom=10&scale=2&maptype=roadmap&markers=<?php echo $loc; ?>'
431
  alt='' width='320' height='240'/></a>
432
  </div>
433
  </div>
inc/functions.php CHANGED
@@ -425,12 +425,14 @@ function gmedia_gallery_query_data($query = array()){
425
  );
426
  }
427
 
428
- function gmedia_array_filter_recursive($input){
429
- foreach($input as &$value){
430
- if(is_array($value)){
431
- $value = gmedia_array_filter_recursive($value);
432
- }
433
- }
434
-
435
- return array_filter($input);
 
 
436
  }
425
  );
426
  }
427
 
428
+ function gmedia_array_filter_recursive( $input ) {
429
+ foreach ( $input as &$value ) {
430
+ if ( is_array( $value ) ) {
431
+ $value = gmedia_array_filter_recursive( $value );
432
+ }
433
+ }
434
+
435
+ return array_filter( $input, function( $val ) {
436
+ return is_string( $val ) ? strlen( $val ) : ! empty( $val );
437
+ } );
438
  }
inc/map-editor.php CHANGED
@@ -89,7 +89,7 @@ function gmedia_map_editor()
89
  } else {
90
  var script = document.createElement("script");
91
  script.type = "text/javascript";
92
- script.src = "//maps.googleapis.com/maps/api/js?v=3&key=AIzaSyBMiF6nlG5O1tE81Q-35_dckOwW4ypMRuk&callback=handleApiReady";
93
  document.body.appendChild(script);
94
  }
95
  }
89
  } else {
90
  var script = document.createElement("script");
91
  script.type = "text/javascript";
92
+ script.src = "//maps.googleapis.com/maps/api/js?v=3&key=" + GmediaGallery.google_api_key + "&callback=handleApiReady";
93
  document.body.appendChild(script);
94
  }
95
  }
inc/media-upload.php CHANGED
@@ -192,7 +192,7 @@ function gmedia_add_media_galleries(){
192
  'number' => $gmCore->_get('number', $per_page),
193
  'hide_empty' => 0,
194
  'page' => $gmCore->_get('pager', 1),
195
- 'status' => array('publish', 'private')
196
  );
197
  $args['offset'] = ($args['page'] - 1) * $args['number'];
198
 
@@ -257,6 +257,8 @@ function gmedia_add_media_galleries(){
257
  $list_row_class = '';
258
  if('private' == $term->status){
259
  $list_row_class = ' list-group-item-info';
 
 
260
  }
261
  ?>
262
  <div class="gmedia-insert-item list-group-item clearfix d-row<?php echo $list_row_class; ?>" id="list-item-<?php echo $term->term_id; ?>" data-id="<?php echo $term->term_id; ?>" data-type="<?php echo $term_meta['_module']; ?>">
@@ -294,6 +296,21 @@ function gmedia_add_media_galleries(){
294
  <span class="label label-default"><?php _e('Last Edited', 'grand-media'); ?>:</span> <?php echo $term_meta['_edited']; ?>
295
  <br><span class="label label-default"><?php _e('Query Args.', 'grand-media'); ?>:</span> <?php echo !empty($term_meta['_query'])? str_replace(',"', ', "', json_encode($term_meta['_query'])) : ''; ?>
296
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  <?php if(current_user_can('gmedia_gallery_manage')){
298
  if(!(((int)$term->global != $user_ID) && !current_user_can('gmedia_edit_others_media'))){
299
  ?>
@@ -394,7 +411,7 @@ function gmedia_add_media_terms(){
394
 
395
  switch($taxonomy){
396
  case 'gmedia_album':
397
- $args['status'] = array('publish', 'private');
398
  $args['global'] = $gmCore->_get('author', $gmCore->caps['gmedia_edit_others_media']? '' : array(0, $user_ID));
399
  if(!$gmCore->caps['gmedia_show_others_media']){
400
  $args['global'] = wp_parse_id_list($args['global']);
@@ -476,8 +493,8 @@ function gmedia_add_media_terms(){
476
  if('private' == $item->status){
477
  $list_row_class = ' list-group-item-info';
478
  } elseif('draft' == $item->status){
479
- //$list_row_class = ' list-group-item-warning';
480
- continue;
481
  }
482
  }
483
  }
@@ -601,7 +618,23 @@ function gmedia_add_media_terms(){
601
  <?php } ?>
602
  <br/><strong><?php _e('Module/Preset', 'grand-media'); ?>:</strong> <?php echo $module_preset; ?>
603
  </p>
604
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
605
  <p>
606
  <a href="<?php echo add_query_arg(array('page' => 'GrandMedia',
607
  $lib_arg[ $taxonomy ] => $item->term_id
192
  'number' => $gmCore->_get('number', $per_page),
193
  'hide_empty' => 0,
194
  'page' => $gmCore->_get('pager', 1),
195
+ //'status' => array('publish', 'private')
196
  );
197
  $args['offset'] = ($args['page'] - 1) * $args['number'];
198
 
257
  $list_row_class = '';
258
  if('private' == $term->status){
259
  $list_row_class = ' list-group-item-info';
260
+ } elseif('draft' == $term->status){
261
+ $list_row_class = ' list-group-item-warning';
262
  }
263
  ?>
264
  <div class="gmedia-insert-item list-group-item clearfix d-row<?php echo $list_row_class; ?>" id="list-item-<?php echo $term->term_id; ?>" data-id="<?php echo $term->term_id; ?>" data-type="<?php echo $term_meta['_module']; ?>">
296
  <span class="label label-default"><?php _e('Last Edited', 'grand-media'); ?>:</span> <?php echo $term_meta['_edited']; ?>
297
  <br><span class="label label-default"><?php _e('Query Args.', 'grand-media'); ?>:</span> <?php echo !empty($term_meta['_query'])? str_replace(',"', ', "', json_encode($term_meta['_query'])) : ''; ?>
298
  </p>
299
+ <?php if('draft' == $term->status){
300
+ if($term->global && !is_super_admin($term->global)) {
301
+ ?>
302
+ <p class="text-danger"><?php printf( __( 'This gallery will be loaded only for %s and admin users', 'grand-media' ), get_the_author_meta( 'display_name', $term->global ) ); ?></p>
303
+ <?php
304
+ } else {
305
+ ?>
306
+ <p class="text-danger"><?php _e( 'This gallery will be loaded only for admin users', 'grand-media' ); ?></p>
307
+ <?php
308
+ }
309
+ } elseif('private' == $term->status){
310
+ ?>
311
+ <p class="text-warning"><?php _e( 'This gallery will be loaded only for logged in users', 'grand-media' ); ?></p>
312
+ <?php
313
+ } ?>
314
  <?php if(current_user_can('gmedia_gallery_manage')){
315
  if(!(((int)$term->global != $user_ID) && !current_user_can('gmedia_edit_others_media'))){
316
  ?>
411
 
412
  switch($taxonomy){
413
  case 'gmedia_album':
414
+ //$args['status'] = array('publish', 'private');
415
  $args['global'] = $gmCore->_get('author', $gmCore->caps['gmedia_edit_others_media']? '' : array(0, $user_ID));
416
  if(!$gmCore->caps['gmedia_show_others_media']){
417
  $args['global'] = wp_parse_id_list($args['global']);
493
  if('private' == $item->status){
494
  $list_row_class = ' list-group-item-info';
495
  } elseif('draft' == $item->status){
496
+ $list_row_class = ' list-group-item-warning';
497
+ //continue;
498
  }
499
  }
500
  }
618
  <?php } ?>
619
  <br/><strong><?php _e('Module/Preset', 'grand-media'); ?>:</strong> <?php echo $module_preset; ?>
620
  </p>
621
+ <?php if('gmedia_album' == $taxonomy){
622
+ if('draft' == $item->status) {
623
+ if ( $item->global && ! is_super_admin( $item->global ) ) {
624
+ ?>
625
+ <p class="text-danger"><?php printf( __( 'This gallery will be loaded only for %s and admin users', 'grand-media' ), $owner ); ?></p>
626
+ <?php
627
+ } else {
628
+ ?>
629
+ <p class="text-danger"><?php _e( 'This gallery will be loaded only for admin users', 'grand-media' ); ?></p>
630
+ <?php
631
+ }
632
+ } elseif('private' == $item->status){
633
+ ?>
634
+ <p class="text-warning"><?php _e( 'This gallery will be loaded only for logged in users', 'grand-media' ); ?></p>
635
+ <?php
636
+ }
637
+ } ?>
638
  <p>
639
  <a href="<?php echo add_query_arg(array('page' => 'GrandMedia',
640
  $lib_arg[ $taxonomy ] => $item->term_id
inc/shortcodes.php CHANGED
@@ -82,7 +82,8 @@ function gmedia_shortcode($atts, $shortcode_post_content = ''){
82
  $id = isset($atts['id'])? (int)$atts['id'] : 0;
83
  $userid = get_current_user_id();
84
  if($id && ($term = gmedia_shortcode_id_data($id))){
85
- if(('publish' !== $term->status && !$userid) || ('draft' === $term->status && $userid != $term->global)){
 
86
  return '';
87
  }
88
 
@@ -114,6 +115,12 @@ function gmedia_shortcode($atts, $shortcode_post_content = ''){
114
  $query['orderby'] = 'gmedia__in';
115
  }
116
  }
 
 
 
 
 
 
117
  if(isset($atts['orderby'])){
118
  $query['orderby'] = $atts['orderby'];
119
  }
@@ -253,6 +260,19 @@ function gmedia_shortcode($atts, $shortcode_post_content = ''){
253
  if(0 === count($gmedia)){
254
  return '<div class="gmedia_gallery gmedia_gallery_empty" data-gmid="' . esc_attr($id) . '" data-module="' . $_module . '">' . __('Gallery is empty') . '<br />' . $shortcode_post_content . '</div>';
255
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  }
257
 
258
  $is_bot = false;
@@ -282,11 +302,21 @@ function gmedia_shortcode($atts, $shortcode_post_content = ''){
282
 
283
  $out = '<div class="' . $sc_classes . '" id="' . esc_attr($sc_id) . '" data-gmid="' . esc_attr($id) . '" data-module="' . esc_attr($_module) . '"' . $sc_styles . '>';
284
 
285
- ob_start();
286
- /** @noinspection PhpIncludeInspection */
287
- include($module['path'] . '/init.php');
288
- $module_content = ob_get_contents();
289
- ob_end_clean();
 
 
 
 
 
 
 
 
 
 
290
 
291
  if($moduleCSS || $customCSS){
292
  $out .= "<style type='text/css' class='gmedia_module_style_import'>{$moduleCSS}";
82
  $id = isset($atts['id'])? (int)$atts['id'] : 0;
83
  $userid = get_current_user_id();
84
  if($id && ($term = gmedia_shortcode_id_data($id))){
85
+ $is_gallery_visible = ('publish' !== $term->status && !$userid) || ('draft' === $term->status && $userid != $term->global && !is_super_admin());
86
+ if(apply_filters('is_gmedia_gallery_visible', $is_gallery_visible)){
87
  return '';
88
  }
89
 
115
  $query['orderby'] = 'gmedia__in';
116
  }
117
  }
118
+ if(empty($term)){
119
+ $term = (object) array(
120
+ 'name' => '',
121
+ 'description' => '',
122
+ );
123
+ }
124
  if(isset($atts['orderby'])){
125
  $query['orderby'] = $atts['orderby'];
126
  }
260
  if(0 === count($gmedia)){
261
  return '<div class="gmedia_gallery gmedia_gallery_empty" data-gmid="' . esc_attr($id) . '" data-module="' . $_module . '">' . __('Gallery is empty') . '<br />' . $shortcode_post_content . '</div>';
262
  }
263
+ } else {
264
+ $gmDB->gmedias_album_stuff($query);
265
+ $gmDB->gmedias_category_stuff($query);
266
+ $gmDB->gmedias_tag_stuff($query);
267
+ if(isset($query['album__in'])){
268
+ $query['album__in'] = join( ',', $query['album__in']);
269
+ }
270
+ if(isset($query['category__in'])){
271
+ $query['category__in'] = join( ',', $query['category__in']);
272
+ }
273
+ if(isset($query['tag__in'])){
274
+ $query['tag__in'] = join( ',', $query['tag__in']);
275
+ }
276
  }
277
 
278
  $is_bot = false;
302
 
303
  $out = '<div class="' . $sc_classes . '" id="' . esc_attr($sc_id) . '" data-gmid="' . esc_attr($id) . '" data-module="' . esc_attr($_module) . '"' . $sc_styles . '>';
304
 
305
+ if(
306
+ in_array($_module, array('albums-switcher', 'photocluster', 'albumsview'))
307
+ && empty($query['album__in']) && empty($query['category__in']) && empty($query['tag__in'])
308
+ ){
309
+ $out = __('This Gmedia gallery module require at least one term (album, category or tag) to be chosen in Query Builder.', 'grand-media');
310
+ $module_content = '';
311
+ } else {
312
+
313
+ ob_start();
314
+ /** @noinspection PhpIncludeInspection */
315
+ include( $module['path'] . '/init.php' );
316
+ $module_content = ob_get_contents();
317
+ ob_end_clean();
318
+
319
+ }
320
 
321
  if($moduleCSS || $customCSS){
322
  $out .= "<style type='text/css' class='gmedia_module_style_import'>{$moduleCSS}";
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === Gmedia Photo Gallery ===
2
  Contributors: pasyuk
3
  Donate link: https://codeasily.com/donate/
4
- Tags: gallery, albums, photo gallery, gallery lightbox, gallery comments
5
  Requires at least: 3.7
6
  Tested up to: 4.9.1
7
  Stable tag: trunk
@@ -142,6 +142,47 @@ Use [Gmedia Support Forum](https://codeasily.com/community/forum/gmedia-gallery-
142
  = Modules Updated =
143
  * Go to Gmedia Modules page and update installed premium modules to latest versions
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  = v1.12.4 =
146
  * Fixed JS error on Module Preset Edit page
147
 
1
  === Gmedia Photo Gallery ===
2
  Contributors: pasyuk
3
  Donate link: https://codeasily.com/donate/
4
+ Tags: gallery, image gallery, photo gallery, albums gallery, wordpress gallery plugin
5
  Requires at least: 3.7
6
  Tested up to: 4.9.1
7
  Stable tag: trunk
142
  = Modules Updated =
143
  * Go to Gmedia Modules page and update installed premium modules to latest versions
144
 
145
+ = v1.13.2 =
146
+ * Fix issue with ajax modules
147
+
148
+ = v1.13.0 =
149
+ * Added Google API Key field to Settings page (required for Google Maps properly working)
150
+ * Added draft galleries/albums to shortcode generator
151
+ * Fixed admin user now can see draft galleries
152
+ * Fixed conflict with Elementor plugin
153
+ * Fixed datetime JS error
154
+ * Small fixes and improvements
155
+
156
+ = v1.12.12 =
157
+ * Fixed conflict with "Everest Tab" plugin
158
+
159
+ = v1.12.11 =
160
+ * Magnific Popup arrows fix for some themes
161
+
162
+ = v1.12.10 =
163
+ * Required changes for AlbumsGrid module
164
+
165
+ = v1.12.9 =
166
+ * New WoowBox Gallery plugin
167
+
168
+ = v1.12.8 =
169
+ * Fixed counters for gallery modules
170
+ * Fixed AlbumsList Masonry module
171
+
172
+ = v1.12.7 =
173
+ * Fixed scroll bug on Gmedia Library
174
+ * Fixed AlbumsList module
175
+ * Fixed terms for music in splash modules
176
+
177
+ = v1.12.6 =
178
+ * Fixed some splash modules doesn't show more than 40 terms
179
+
180
+ = v1.12.5 =
181
+ * Fixed conflict of color input with some other plugins
182
+ * Fixed PHP Notices for Albums modules
183
+ * Fixed 'Select in Library' on Edit Preset page
184
+ * Small fixes and improvements
185
+
186
  = v1.12.4 =
187
  * Fixed JS error on Module Preset Edit page
188