Skip to content

Commit

Permalink
$mol_date: fixed dynamic month
Browse files Browse the repository at this point in the history
  • Loading branch information
jin committed Sep 28, 2023
1 parent ce9d6c2 commit 0af6cf1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions date/date.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion date/date.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
6 changes: 4 additions & 2 deletions date/demo/demo.view.tree
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion date/demo/demo.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' )
}

}
Expand Down

0 comments on commit 0af6cf1

Please sign in to comment.