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