File tree Expand file tree Collapse file tree 2 files changed +10
-17
lines changed Expand file tree Collapse file tree 2 files changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -30,17 +30,11 @@ export default Base.extend({
3030 name : "date-picker" ,
3131 trigger : ".pat-date-picker" ,
3232
33- async init ( el , opts ) {
34- if ( el . jquery ) {
35- el = el [ 0 ] ;
36- }
33+ async init ( $el , opts ) {
34+ const el = this . el ;
3735 //TODO: make parser with options extend missing options.
3836 //this.options = parser.parse(el, opts);
39- this . options = $ . extend ( parser . parse ( this . $el ) , this . options ) ;
40- console . log ( "3" ) ;
41- console . log ( opts ) ;
42- console . log ( "4" ) ;
43- console . log ( this . options ) ;
37+ this . options = $ . extend ( parser . parse ( el ) , opts ) ;
4438
4539 this . polyfill = this . options . behavior === "native" ;
4640 if ( this . polyfill && utils . checkInputSupport ( "date" , "invalid date" ) ) {
@@ -70,8 +64,6 @@ export default Base.extend({
7064 $ ( this . _o . field ) . trigger ( "input-change" ) ;
7165 } ,
7266 } ;
73- console . log ( "2" ) ;
74- console . log ( config ) ;
7567
7668 if ( el . getAttribute ( "min" ) ) {
7769 config . minDate = Moment ( el . getAttribute ( "min" ) ) . toDate ( ) ;
@@ -80,7 +72,10 @@ export default Base.extend({
8072 config . maxDate = Moment ( el . getAttribute ( "max" ) ) . toDate ( ) ;
8173 }
8274
75+ console . log ( "iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii" ) ;
76+ console . log ( this . options ) ;
8377 if ( this . options . i18n ) {
78+ console . log ( "OKAY" ) ;
8479 $ . getJSON ( this . options . i18n )
8580 . done ( ( data ) => {
8681 config . i18n = data ;
Original file line number Diff line number Diff line change 11/* pat-datetime-picker - Polyfill for input type=datetime-local */
22import "regenerator-runtime/runtime" ; // needed for ``await`` support
3+ import $ from "jquery" ;
34import Base from "../../core/base" ;
45import DatePicker from "../date-picker/date-picker" ;
56import Parser from "../../core/parser" ;
@@ -20,12 +21,9 @@ export default Base.extend({
2021 name : "datetime-picker" ,
2122 trigger : ".pat-datetime-picker" ,
2223
23- async init ( el , opts ) {
24- if ( el . jquery ) {
25- el = el [ 0 ] ;
26- }
27- this . el = el ;
28- this . options = parser . parse ( el , opts ) ;
24+ async init ( $el , opts ) {
25+ const el = this . el ;
26+ this . options = $ . extend ( parser . parse ( el ) , opts ) ;
2927
3028 Moment = await import ( "moment" ) ;
3129 Moment = Moment . default ;
You can’t perform that action at this time.
0 commit comments