differenceTime static method
Return diff time
Implementation
static Duration differenceTime(dynamic tanggalAwal, dynamic tanggalAkhir) {
DateTime awal, akhir;
if (tanggalAwal is DateTime) {
awal = tanggalAwal;
} else {
return const Duration(milliseconds: 0);
}
if (tanggalAkhir is DateTime) {
akhir = tanggalAkhir;
} else {
return const Duration(milliseconds: 0);
}
Duration duration = akhir.difference(awal);
return duration;
}