Ajuste no Input de data
This commit is contained in:
parent
6dee93591c
commit
08f35a7126
|
@ -100,9 +100,9 @@ class ScheduleCompleteVisitPageModel
|
|||
}
|
||||
if (val != '0') {
|
||||
try {
|
||||
DateTime startDate = DateFormat('d/M/y H:mm:ss').parse(val);
|
||||
DateTime startDate = DateFormat('dd/MM/yyyy HH:mm:ss').parse(val);
|
||||
DateTime endDate =
|
||||
DateFormat('d/M/y H:mm:ss').parse(textController2!.text);
|
||||
DateFormat('dd/MM/yyyy HH:mm:ss').parse(textController2!.text);
|
||||
if (startDate.isAfter(endDate)) {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'A data de início deve ser anterior à data de término.',
|
||||
|
@ -136,7 +136,7 @@ class ScheduleCompleteVisitPageModel
|
|||
ptText: 'Este campo é obrigatório.',
|
||||
);
|
||||
}
|
||||
if (val != null) {
|
||||
if (val != '0') {
|
||||
try {
|
||||
DateTime endDate = DateFormat('dd/M/yyyy HH:mm:ss').parse(val);
|
||||
DateTime startDate =
|
||||
|
|
|
@ -522,7 +522,7 @@ Widget scheduleVisit(BuildContext context,
|
|||
}
|
||||
safeSetState(() {
|
||||
_model.textController1?.text = dateTimeFormat(
|
||||
'd/M/y H:mm:ss',
|
||||
'dd/MM/yyyy HH:mm:ss',
|
||||
_model.datePicked1,
|
||||
locale: FFLocalizations.of(context)
|
||||
.languageCode,
|
||||
|
@ -772,7 +772,7 @@ Widget scheduleVisit(BuildContext context,
|
|||
}
|
||||
safeSetState(() {
|
||||
_model.textController2?.text = dateTimeFormat(
|
||||
'd/M/y H:mm:ss',
|
||||
'dd/MM/yyyy HH:mm:ss',
|
||||
_model.datePicked2,
|
||||
locale: FFLocalizations.of(context)
|
||||
.languageCode,
|
||||
|
|
Loading…
Reference in New Issue