1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-25 22:39:22 +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 /// Pick countdown time
Future<void> _pickCountdownTime() async { Future<void> _pickCountdownTime() async {
final initialDate = final yesterday = DateTime.now().subtract(Duration(days: 1));
_timeEnd == null ? DateTime.now().add(Duration(minutes: 1)) : _timeEnd;
final initialDate = _timeEnd == null ? DateTime.now() : _timeEnd;
// Pick date // Pick date
final newDate = await showDatePicker( final newDate = await showDatePicker(
context: context, context: context,
initialDate: initialDate, initialDate: initialDate,
firstDate: DateTime.now(), firstDate: yesterday.isBefore(initialDate) ? yesterday : initialDate,
lastDate: DateTime.now().add(Duration(days: 5000))); lastDate: DateTime.now().add(Duration(days: 5000)));
if (newDate == null) return; if (newDate == null) return;