File tree 3 files changed +5
-13
lines changed
3 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 151
151
return parseDate ( date + '-01' ) ;
152
152
} ;
153
153
var globalSettings = {
154
- datetime : {
154
+ ' datetime-local' : {
155
155
parseFunction : parseDateTime ,
156
156
create : function ( object , settings ) {
157
157
return object . datetimepicker ( settings ) ;
193
193
validFormat : '\\d{2}:\\d{2}'
194
194
}
195
195
} ;
196
- globalSettings [ 'datetime-local' ] = globalSettings . datetime ;
197
- globalSettings [ 'datetime-local' ] . validFormat += '.*' ; // timezone
198
196
199
197
$ . fn . dateinput = function ( userSettings ) {
200
198
this . each ( function ( ) {
263
261
264
262
//
265
263
switch ( type ) {
266
- case 'datetime' :
267
264
case 'datetime-local' :
268
265
$ . extend ( pickerSettings , {
269
266
altFieldTimeOnly : false ,
Original file line number Diff line number Diff line change @@ -38,17 +38,13 @@ initialize the calendar using javascript:
38
38
``` js
39
39
$ (document ).ready (function () {
40
40
$ (' input[data-dateinput-type]' ).dateinput ({
41
- datetime: {
41
+ ' datetime-local ' : {
42
42
dateFormat: ' d.m.yy' ,
43
43
timeFormat: ' H:mm' ,
44
- options: { // options for type=datetime
44
+ options: { // options for type=datetime-local
45
45
changeYear: true
46
46
}
47
47
},
48
- ' datetime-local' : {
49
- dateFormat: ' d.m.yy' ,
50
- timeFormat: ' H:mm'
51
- },
52
48
date: {
53
49
dateFormat: ' d.m.yy'
54
50
},
Original file line number Diff line number Diff line change 43
43
*/
44
44
class DateInput extends BaseControl {
45
45
46
- public const TYPE_DATETIME = ' datetime ' ,
46
+ public const
47
47
TYPE_DATETIME_LOCAL = 'datetime-local ' ,
48
48
TYPE_DATE = 'date ' ,
49
49
TYPE_MONTH = 'month ' ,
@@ -65,7 +65,6 @@ class DateInput extends BaseControl {
65
65
public static $ defaultValidMessage = 'Please enter a valid date. ' ;
66
66
67
67
private static $ formats = [
68
- self ::TYPE_DATETIME => 'Y-m-d\TH:i:se ' ,
69
68
self ::TYPE_DATETIME_LOCAL => 'Y-m-d\TH:i:s ' ,
70
69
self ::TYPE_DATE => 'Y-m-d ' ,
71
70
self ::TYPE_MONTH => 'Y-m ' ,
@@ -78,7 +77,7 @@ public static function register($immutable = true): void {
78
77
Container $ form ,
79
78
string $ name ,
80
79
string $ label = null ,
81
- string $ type = ' datetime-local '
80
+ string $ type = self :: TYPE_DATETIME_LOCAL
82
81
) use ($ immutable ) {
83
82
$ component = new self ($ label , $ type , $ immutable );
84
83
$ form ->addComponent ($ component , $ name );
You can’t perform that action at this time.
0 commit comments