Skip to content

Conversation

@dvoituron
Copy link
Collaborator

@dvoituron dvoituron commented Jun 12, 2023

FluentCalendar, FluentDatePicker and FluentTimePicker components

📖 Description

This PR adds the FuentCalendar, FluentDatePicker and FluentTimePicker components, as well as the associated unit tests.

The calendar features a Culture property to display days in the user's language. By default, the OS culture is used. It is possible to disable certain dates using the DisabledDateFunc function, which returns a boolean, depending on the date proposed. If required, the developer can fully customize the visual of a day via the DaysTemplate.

An extension method ToTimeAgo(TimeSpan delay) returns a string with one of these samples, depending of the delay: "Just now", "25 seconds ago", "14 minutes ago", ...

DatePicker
DatePicker
TimePicker

✅ Checklist

General

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

  • I have added a new component
  • I have modified an existing component

Breaking changes

Old FluentCalendar New FluentCalendar
✅ Readonly No change - Case updated to ReadOnly to be coherent.
✅ Locale ⚠️ Culture This property is a CultureInfo object more precise to customize rendering (including first day of week: Sunday, Monday, ...).Migration from Locale ("fr-FR") to Culture: System.Globalization.CultureInfo.GetCultureInfo("fr-FR")
✅ Month & Year PickerMonth This new property is more Blazor/C#, because it's a DateTime object. And a two-way bindable property.
✅ DayFormat No change
🚫 WeekdayFormat ⚠️Breaking change - No implementedUse the Abbreviated value of .NET system weekday names.
🚫 MonthFormat ⚠️Breaking change - No implementedUse the Full month name.
🚫 MinWeeks ⚠️Breaking change - No implemented
🚫 OutOfMonthSelectable ⚠️Breaking change - No implemented
✅ DisabledDates & DisabledSelectable DisabledDateFunc This property is a function. More interesting if you have a lot of dates to deactivate. You can create a function to get these dates from a DB and not fill a large array of dates in memory.DisabledSelectable True to display the Strikethrough style. False to display the day like other, but not selectable.
⬜ SelectedDates & SelectedDatesChanged SelectedDate & SelectedDateChangedAt this moment, only one date is selectable
✅ OnDateClicked No change
🚫 ChildContent ⚠️Breaking change - Removed

@vnbaaij vnbaaij merged commit 3691de4 into new-components Jun 12, 2023
@vnbaaij vnbaaij deleted the users/dvoituron/datetime branch June 12, 2023 10:56
@LuohuaRain
Copy link
Contributor

I am wondering if the value of FluentDatePicker should be of the DateOnly type, and if the value of FluentTimePicker should be of the TimeOnly type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants