translation

merge-requests/278/head
mosazaid 4 years ago
parent cca4e33fce
commit 2273808333

@ -616,7 +616,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
.white, .white,
), ),
AppText( AppText(
" ${DateUtils.getAgeByBirthday(item.dateofBirth)}", " ${DateUtils.getAgeByBirthday(item.dateofBirth, context)}",
fontSize: 1.8 * fontSize: 1.8 *
SizeConfig SizeConfig

@ -217,7 +217,7 @@ class DateUtils {
} }
} }
static String getAgeByBirthday(dynamic birthday){ static String getAgeByBirthday(dynamic birthday, BuildContext context){
// https://leechy.dev/calculate-dates-diff-in-dart // https://leechy.dev/calculate-dates-diff-in-dart
DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday);
final now = DateTime.now(); final now = DateTime.now();
@ -232,7 +232,7 @@ class DateUtils {
final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day); final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day);
days = now.difference(monthAgo).inDays + 1; days = now.difference(monthAgo).inDays + 1;
} }
return "$years Yr $months Mnth $days Day"; return "$years ${TranslationBase.of(context).years} $months ${TranslationBase.of(context).months} $days ${TranslationBase.of(context).days}";
} }
} }

@ -117,7 +117,7 @@ class PatientProfileWidget extends StatelessWidget {
height: 4, height: 4,
), ),
AppText( AppText(
"${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth)/*patient.age*/}", "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)/*patient.age*/}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize: 1.6 * SizeConfig.textMultiplier,
), ),

Loading…
Cancel
Save