mytooyo / board_datetime_picker

Picker to select date and time for Flutter. It is both a calendar and a picker, offering a variety of options as a package.
BSD 3-Clause "New" or "Revised" License
14 stars 12 forks source link

Active day problem | Day order on calendar | pickers order #7

Closed matteoberla closed 1 year ago

matteoberla commented 1 year ago

I'm leaving some images of the issues found: -I've noticed that today ( 30th October 2023 ), when I open the BoardDateTimePicker the active Day is 31st October, but "Today" tab is selected.

board selected day issue

-If i select 30th October, both 30th and 29th are selected as shown, "Today" tab is selected too (which is correct).

board selected day 29-30

-If i press "Tomorrow" tab, 1st November is selected (31st should be selected), and I can't navigate to the next page of the calendar as the arrow are disabled.

selected day tomorrow

Not an issue but a question: is it possible to set the first day of the week showed in the calendar? Now it's Sunday by default but I would like to set Monday.

Values used and code:

/*
initialDate: 2023-10-30 08:13:18.000
minimumDate: 2023-10-30 08:13:12.000
maximumDate: 2023-11-01 08:24:31.218
textColor: Color(0xff000000)
activeColor: MaterialColor(primary value: Color(0xff607d8b))
activeTextColor: Color(0xffffffff)
*/

DateTime? selectedDate = await showBoardDateTimePicker(
      context: context,
      pickerType: DateTimePickerType.datetime,
      initialDate: DateTime.tryParse(nextEventTime),
      minimumDate: minTime,
      maximumDate: maxTime,
      options: const BoardDateTimeOptions(
        languages: BoardPickerLanguages.it(),
        textColor: darkTextColor,
        activeColor: mainColor,
        activeTextColor: lightTextColor,
      ),
    );
mytooyo commented 1 year ago

Sorry, I think it is due to daylight saving time. I will correct it.

is it possible to set the first day of the week showed in the calendar? Now it's Sunday by default but I would like to set Monday.

It is not supported at this time. I will respond if needed.

matteoberla commented 1 year ago

if you have time to do it, it would be useful to have a setter for the first day as i know that for different countries there are different standards.

Another thing that i noticed, is it possible to change the order of the years-months-days pickers? I know that for USA or UK is yyyy MM dd, but for example in italy we only use dd MM yyyy

mytooyo commented 1 year ago

Thanks for letting me know. I will support the selection of the day of the week for the start and change the order of the pickers.

mytooyo commented 1 year ago

@matteoberla In v1.3.0, in addition to the above bugs, the picker order has been swapped and the starting day of the week has been changed.

final result = await showBoardDateTimePicker(
  context: context,
  pickerType: DateTimePickerType.datetime,
  options: const BoardDateTimeOptions(
    languages: BoardPickerLanguages.it(),
    startDayOfWeek: DateTime.monday, // <- start day of the week
    pickerFormat: PickerFormat.dmy, // <- picker order
  ),
);
matteoberla commented 1 year ago

Thank you very much, I appreciate it a lot. Amazing job.

mytooyo commented 1 year ago

Thanks for using it! If you need anything else...