diff --git a/date/date.view.tree b/date/date.view.tree index 6e38476a2e1..1f5ad4a2ae1 100644 --- a/date/date.view.tree +++ b/date/date.view.tree @@ -11,6 +11,7 @@ $mol_date $mol_pick <= Today_icon $mol_icon_calendar_today <= Input $mol_format value? <=> value? \ + value_changed? => value_changed? mask* <= input_mask* \ enabled <= enabled true <= Clear $mol_button_minor diff --git a/date/date.view.ts b/date/date.view.ts index 57ce377fc48..f03458f27bf 100644 --- a/date/date.view.ts +++ b/date/date.view.ts @@ -89,7 +89,7 @@ namespace $.$$ { if( next ) return next - let moment = $mol_try( ()=> new $mol_time_moment( this.value() ) ) + let moment = $mol_try( ()=> new $mol_time_moment( this.value_changed().replace( /\D+$/, '' ) ) ) if( moment instanceof Error || !moment.year ) return new $mol_time_moment if( moment.month === undefined ) { diff --git a/date/demo/demo.view.tree b/date/demo/demo.view.tree index 2828173fcb7..e96d19afb0d 100644 --- a/date/demo/demo.view.tree +++ b/date/demo/demo.view.tree @@ -1,10 +1,12 @@ $mol_date_demo $mol_example_small sub / - <= Date $mol_date - value_moment? <=> date? $mol_time_moment + <= Current $mol_date + value_moment? <=> date_current? $mol_time_moment <= Formatted $mol_view sub / <= formatted \ + <= Empty $mol_date + value_moment? <=> date_empty? null tags / \time \datepicker diff --git a/date/demo/demo.view.ts b/date/demo/demo.view.ts index cbdb23e5e2e..92ebecd7e1e 100644 --- a/date/demo/demo.view.ts +++ b/date/demo/demo.view.ts @@ -3,7 +3,7 @@ namespace $.$$ { export class $mol_date_demo extends $.$mol_date_demo { formatted( ){ - return this.date()?.toString( 'DD Month YYYY hh:mm' ) + return this.date_current()?.toString( 'DD Month YYYY hh:mm' ) } }