@@ -520,12 +520,10 @@ class _PlanFormState extends State<PlanForm> {
520
520
521
521
_onlyLogging = widget._plan.onlyLogging;
522
522
_descriptionController.text = widget._plan.description;
523
- _startDateController.text =
524
- '${widget ._plan .startDate .year }-${widget ._plan .startDate .month .toString ().padLeft (2 , '0' )}-${widget ._plan .startDate .day .toString ().padLeft (2 , '0' )}' ;
523
+ _startDateController.text = dateToYYYYMMDD (widget._plan.startDate)! ;
525
524
// ignore invalid enddates should the server gives us one
526
525
if (widget._plan.endDate != null && widget._plan.endDate! .isAfter (widget._plan.startDate)) {
527
- _endDateController.text =
528
- '${widget ._plan .endDate !.year }-${widget ._plan .endDate !.month .toString ().padLeft (2 , '0' )}-${widget ._plan .endDate !.day .toString ().padLeft (2 , '0' )}' ;
526
+ _endDateController.text = dateToYYYYMMDD (widget._plan.endDate)! ;
529
527
}
530
528
if (widget._plan.hasAnyAdvancedGoals) {
531
529
_goalType = GoalType .advanced;
@@ -585,8 +583,7 @@ class _PlanFormState extends State<PlanForm> {
585
583
586
584
if (pickedDate != null ) {
587
585
setState (() {
588
- _startDateController.text =
589
- '${pickedDate .year }-${pickedDate .month .toString ().padLeft (2 , '0' )}-${pickedDate .day .toString ().padLeft (2 , '0' )}' ;
586
+ _startDateController.text = dateToYYYYMMDD (pickedDate)! ;
590
587
widget._plan.startDate = pickedDate;
591
588
});
592
589
}
@@ -625,8 +622,7 @@ class _PlanFormState extends State<PlanForm> {
625
622
626
623
if (pickedDate != null ) {
627
624
setState (() {
628
- _endDateController.text =
629
- '${pickedDate .year }-${pickedDate .month .toString ().padLeft (2 , '0' )}-${pickedDate .day .toString ().padLeft (2 , '0' )}' ;
625
+ _endDateController.text = dateToYYYYMMDD (pickedDate)! ;
630
626
widget._plan.endDate = pickedDate;
631
627
});
632
628
}
0 commit comments