Modify time and date

merge-requests/62/head
Amjad Amireh 6 years ago
parent ce1a502d32
commit 2f0c400328

@ -51,6 +51,7 @@ class PatiantInformtion {
String genderDescription;
String nursingStationName;
String appointmentDate;
String startTime;
PatiantInformtion({
this.list,
@ -87,6 +88,7 @@ class PatiantInformtion {
this.genderDescription,
this.nursingStationName,
this.appointmentDate,
this.startTime,
});
@ -124,6 +126,7 @@ class PatiantInformtion {
genderDescription: json["GenderDescription"],
nursingStationName: json["NursingStationName"],
appointmentDate: json["AppointmentDate"],
startTime: json["StartTime"],
);

@ -202,7 +202,24 @@ class _PatientsScreenState extends State<PatientsScreen> {
return newDate.toString();
}
convertDateFormat2(String str) {
String timeConvert;
const start = "/Date(";
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
String newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
return newDate.toString();
}
filterBooking(String str) {
this.responseModelList = this.responseModelList2;
@ -350,9 +367,11 @@ class _PatientsScreenState extends State<PatientsScreen> {
patientType)] ==
"List_MyOutPatient"
? AppText(
convertDate(item
convertDateFormat2(item
.appointmentDate
.toString()),
.toString())+" "+"-"+" "+item.startTime
,
fontSize: 2.5 *
SizeConfig
.textMultiplier)

Loading…
Cancel
Save