Skip to content

Commit

Permalink
NAS-207: Reselecting date not maintaining state is fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Prajwal committed May 30, 2023
1 parent 63aaa5a commit eab49a5
Showing 1 changed file with 35 additions and 8 deletions.
43 changes: 35 additions & 8 deletions app/src/main/java/org/intelehealth/app/knowledgeEngine/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -970,12 +970,26 @@ public static void askDate(final Node node, final Activity context, final Questi
*/
// for rest other than physexam screen the maxdate will be todays date so that future dates isnt allowed.
// if (!context.getClass().getSimpleName().equalsIgnoreCase("PhysicalExamActivity"))
if (!node.getText().contains("follow-up"))
datePickerDialog.getDatePicker().setMaxDate(System.currentTimeMillis());
if (!node.getDisplay().contains("follow-up")) {
try {
datePickerDialog.getDatePicker().setMaxDate(System.currentTimeMillis());
}
catch (Exception e) {
Log.v("ddd", "askdate 978line: " + e.toString());
}
}

// if (context.getClass().getSimpleName().equalsIgnoreCase("PhysicalExamActivity"))
if (node.getText().contains("follow-up"))
datePickerDialog.getDatePicker().setMinDate(System.currentTimeMillis() - 1000);
if (node.getDisplay().contains("follow-up")) {
try {
datePickerDialog.getDatePicker().setMinDate(System.currentTimeMillis() - 1000);
}
catch (Exception e) {
Log.v("ddd", "askdate 999line: " + e.toString());
}
}

Log.v("ddd", "dddd: " + node.getText());


datePickerDialog.setOnCancelListener(dialog -> {
Expand Down Expand Up @@ -1638,13 +1652,26 @@ public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth

// for rest other than physexam screen the maxdate will be todays date so that future dates isnt allowed.
// if (!context.getClass().getSimpleName().equalsIgnoreCase("PhysicalExamActivity"))
if (!node.getText().contains("follow-up"))
datePickerDialog.getDatePicker().setMaxDate(System.currentTimeMillis());
if (!node.getDisplay().contains("follow-up")) {
try {
datePickerDialog.getDatePicker().setMaxDate(System.currentTimeMillis());
}
catch (Exception e) {
Log.v("ddd", "askdate 1660line: " + e.toString());
}
}

// if (context.getClass().getSimpleName().equalsIgnoreCase("PhysicalExamActivity"))
if (node.getText().contains("follow-up"))
datePickerDialog.getDatePicker().setMinDate(System.currentTimeMillis() - 1000);
if (node.getDisplay().contains("follow-up")) {
try {
datePickerDialog.getDatePicker().setMinDate(System.currentTimeMillis() - 1000);
}
catch (Exception e) {
Log.v("ddd", "askdate 1670line: " + e.toString());
}
}

Log.v("ddd", "dddd subdate: " + node.getText());
datePickerDialog.show();
}

Expand Down

0 comments on commit eab49a5

Please sign in to comment.