Fix the date format in intervention_medication_view_model

merge-requests/953/head
RoaaGhali98 4 years ago
parent 0895a80d16
commit d3f0f1a141

@ -49,12 +49,8 @@ class InterventionMedicationViewModel extends BaseViewModel {
InterventionMedicationReqModel(
projectID: projectId,
patientID: patientId,
fromDate: AppDateUtils.convertToServerFormat(
fromDate.toString(),
'MM/dd/yyyy'),
toDate: AppDateUtils.convertToServerFormat(
toDate.toString(),
'MM/dd/yyyy'),
fromDate: AppDateUtils.convertDateToServerFormat(fromDate),
toDate: AppDateUtils.convertDateToServerFormat(toDate),
);
hasError = false;
setState(ViewState.BusyLocal);

@ -28,6 +28,10 @@ class AppDateUtils {
return '/Date(${DateFormat(dateFormat).parse(date).millisecondsSinceEpoch})/';
}
static String convertDateToServerFormat(DateTime date) {
return '/Date(${date.millisecondsSinceEpoch})/';
}
static convertDateFromServerFormat(String str, dateFormat) {
var date = getDateTimeFromServerFormat(str);

Loading…
Cancel
Save