@ -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(),
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);