@@ -677,7 +677,10 @@ class NDB_BVL_Instrument_LINST extends \NDB_BVL_Instrument
677
677
// The question should be added to the LinstQuestions in this
678
678
// order, before the _date is stripped below for standard
679
679
// dates to allow XINValidation to recognize the field name
680
- $ this ->LinstQuestions [$ pieces [1 ]] = ['type ' => 'date ' ];
680
+ $ this ->LinstQuestions [$ pieces [1 ]] = [
681
+ 'type ' => 'date ' ,
682
+ 'dateFormat ' => $ dateFormat ,
683
+ ];
681
684
682
685
if ($ dateFormat === 'MonthYear ' ) {
683
686
// Shows date without day of month
@@ -980,15 +983,27 @@ class NDB_BVL_Instrument_LINST extends \NDB_BVL_Instrument
980
983
$ q ['UserRules ' ] = true ;
981
984
982
985
switch ($ q ['type ' ]) {
986
+ // Selects (including multiselects), Basic Dates and MonthYears
987
+ // are the only type of rules that aren't part of a group
988
+ // the rest include a _status element
983
989
case 'select ' :
984
- // Selects are the only type of rules that aren't part
985
- // of a group, the rest include a _status element
986
990
$ this ->XINRegisterRule ($ question , $ rules , $ message );
987
991
break ;
992
+ case 'date ' :
993
+ if ($ q ['dateFormat ' ] === 'BasicDate '
994
+ || $ q ['dateFormat ' ] === 'MonthYear '
995
+ ) {
996
+ $ this ->XINRegisterRule ($ question , $ rules , $ message );
997
+ break ;
998
+ }
988
999
default :
1000
+ $ rules_array = array_merge (
1001
+ $ rules ,
1002
+ [$ question .'_status{@}=={@} ' ]
1003
+ );
989
1004
$ this ->XINRegisterRule (
990
1005
$ question ,
991
- $ rules ,
1006
+ $ rules_array ,
992
1007
$ message ,
993
1008
$ question . "_group "
994
1009
);
0 commit comments