-
Notifications
You must be signed in to change notification settings - Fork 469
[dev-v5][Calendar] Add MinDate and MaxDate #4620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1a65659
- Add ShowTitleStatic parameter
vnbaaij 0ce8a4a
- Add HeaderInteractive, MinDate and MaxDate parameters
vnbaaij 9ef93e6
Chnge example, process compiler messages, add more tests
vnbaaij 225e360
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/calendar-enhancements
vnbaaij df49d4d
- Undo default example changes
vnbaaij c45cd49
Process review comments: Added AdaptedForMaxDate and AdaptedForMinDat…
vnbaaij 0c4fa82
- Make default example default again
vnbaaij 3a5e1c0
- Fix test
vnbaaij af087b4
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/calendar-enhancements
vnbaaij 0197419
Undo changing test
vnbaaij a9e5ca3
Merge branch 'users/vnbaaij/dev-v5/calendar-enhancements' of https://…
vnbaaij 0b83f1b
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/calendar-enhancements
vnbaaij 318d25f
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/calendar-enhancements
dvoituron 59d87cd
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/calendar-enhancements
vnbaaij 13886cd
- Add tests for RangeOfDates methods
vnbaaij bb7427e
Merge branch 'users/vnbaaij/dev-v5/calendar-enhancements' of https://…
vnbaaij File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...ntUI.Demo.Client/Documentation/Components/DateTime/Calendar/Examples/CalendarMinMax.razor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| <FluentStack Wrap="true" HorizontalGap="24px"> | ||
|
|
||
| <div> | ||
| <FluentCalendar DisabledDateFunc="@DisabledDay" | ||
| @bind-Value="@SelectedDay" | ||
| @bind-PickerMonth="@PickerDay" | ||
| MinDate="@StartOfMonth" | ||
| MaxDate="@EndOfMonth" | ||
| Style="height: 250px; align-content: start;" /> | ||
| <p>Selected @(SelectedDay.ToString("yyyy-MM-dd"))</p> | ||
| <p>Panel @(PickerDay.ToString("yyyy-MM-dd"))</p> | ||
| </div> | ||
|
|
||
| <div> | ||
| <FluentCalendar View="CalendarViews.Months" | ||
| @bind-Value="@SelectedMonth" | ||
| @bind-PickerMonth="@PickerMonth" | ||
| MinDate="@(new DateTime(2026, 3, 1))" | ||
| MaxDate="@(new DateTime(Today.Year+1, 7, 30))" | ||
| Style="height: 250px; align-content: start;" /> | ||
| <p>Selected @(SelectedMonth.ToString("yyyy-MM-dd"))</p> | ||
| <p>Panel @(PickerMonth.ToString("yyyy-MM-dd"))</p> | ||
| </div> | ||
|
|
||
| <div> | ||
| <FluentCalendar View="CalendarViews.Years" | ||
| @bind-Value="@SelectedYear" | ||
| @bind-PickerMonth="@PickerYear" | ||
| MaxDate="@(new DateTime(2030, 7, 30))" | ||
| Style="height: 250px; align-content: start;" /> | ||
| <p>Selected @(SelectedYear.ToString("yyyy-MM-dd"))</p> | ||
| <p>Panel @(PickerYear.ToString("yyyy-MM-dd"))</p> | ||
| </div> | ||
| </FluentStack> | ||
|
|
||
| @code | ||
| { | ||
| private static readonly DateTime Today = DateTime.Today; | ||
| private static readonly DateTime StartOfMonth = new DateTime(Today.Year, Today.Month, 1); | ||
| private static readonly DateTime EndOfMonth = new DateTime(Today.Year, Today.Month, DateTime.DaysInMonth(Today.Year, Today.Month)); | ||
|
|
||
| private DateTime SelectedDay = Today; | ||
| private DateTime PickerDay = StartOfMonth; | ||
| private DateTime SelectedMonth = Today; | ||
| private DateTime PickerMonth = StartOfMonth; | ||
| private DateTime SelectedYear = Today; | ||
| private DateTime PickerYear = StartOfMonth; | ||
|
|
||
| private bool DisabledDay(DateTime date) => date.Day == 3 || date.Day == 8 || date.Day == 20; | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.