-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathload_datetimepicker.ctp
More file actions
40 lines (38 loc) · 1.24 KB
/
load_datetimepicker.ctp
File metadata and controls
40 lines (38 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Element of datetimepicker include
*
* @copyright Copyright 2014, NetCommons Project
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
*/
// datetimepicker
echo $this->NetCommonsHtml->script(
array(
'/components/moment/min/moment.min.js',
'/components/moment/min/moment-with-locales.min.js',
'/components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js',
'/components/angular-bootstrap-datetimepicker-directive/angular-bootstrap-datetimepicker-directive.js',
)
);
echo $this->NetCommonsHtml->css(
'/components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css'
);
?>
<?php echo $this->Html->scriptStart(array('inline' => false)); ?>
NetCommonsApp.requires.push('datetimepicker');
NetCommonsApp.config(
[
'datetimepickerProvider',
function(datetimepickerProvider) {
datetimepickerProvider.setOptions({
locale: moment.locale('<?php echo Configure::read('Config.language') ?>'),
format: 'YYYY-MM-DD HH:mm',
sideBySide: true,
stepping: 5
});
}
]
);
<?php echo $this->Html->scriptEnd();