File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 2020 'date-format' : 'dd/MM/yyyy'
2121 } ;
2222
23- // Set form to dirty when required. Works OK with existing records - hopefully new records will have other field types
23+ // // Set form to dirty when required. Works OK with existing records - hopefully new records will have other field types
2424 var watchField = attrs . model + '.' + attrs . fngFldName ;
2525 var formName = attrs . fngOptName ;
2626 scope . $watch ( watchField , function ( newVal , oldVal ) {
2727 if ( newVal && oldVal && newVal !== oldVal ) {
28- scope [ formName ] . $setDirty ( ) ;
28+ var newComp = ( typeof newVal === 'string' ) ? newVal : newVal . toISOString ( ) ;
29+ var oldComp = ( typeof oldVal === 'string' ) ? oldVal : oldVal . toISOString ( ) ;
30+ if ( newComp !== oldComp ) {
31+ scope [ formName ] . $setDirty ( ) ;
32+ }
2933 }
3034 } ) ;
3135
You can’t perform that action at this time.
0 commit comments