1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-26 12:58:51 +00:00

Fix issue

This commit is contained in:
Pierre HUBERT 2020-04-25 10:10:52 +02:00
parent ee5f791638
commit 8af4a61072

View File

@ -231,14 +231,15 @@ class _PostCreateFormWidgetState extends State<PostCreateFormWidget> {
/// Pick countdown time
Future<void> _pickCountdownTime() async {
final initialDate =
_timeEnd == null ? DateTime.now().add(Duration(minutes: 1)) : _timeEnd;
final yesterday = DateTime.now().subtract(Duration(days: 1));
final initialDate = _timeEnd == null ? DateTime.now() : _timeEnd;
// Pick date
final newDate = await showDatePicker(
context: context,
initialDate: initialDate,
firstDate: DateTime.now(),
firstDate: yesterday.isBefore(initialDate) ? yesterday : initialDate,
lastDate: DateTime.now().add(Duration(days: 5000)));
if (newDate == null) return;