Skip to content
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

Enable changeYear option for datepicker #16376

Merged
merged 4 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Improved how fields are sized in responsive field layouts. ([#16303](https://github.com/craftcms/cms/pull/16303))
- Entry indexes now only show table column options and sort options for custom fields associated with the selected sections/entry types within custom entry sources’ conditions.
- Structure views are now available to element indexes on mobile browsers. ([#16190](https://github.com/craftcms/cms/discussions/16190))
- Datepickers now include a dropdown menu for selecting the year. ([#16376](https://github.com/craftcms/cms/pull/16376))
- Heads-up displays now reposition themselves on window scroll.

### Accessibility
Expand Down
1 change: 1 addition & 0 deletions src/web/assets/cp/CpAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ private function _datepickerOptions(Locale $formattingLocale, Locale $locale, ?U
{
return [
'constrainInput' => false,
'changeYear' => true,
'dateFormat' => $formattingLocale->getDateFormat(Locale::LENGTH_SHORT, Locale::FORMAT_JUI),
'dayNames' => $locale->getWeekDayNames(Locale::LENGTH_FULL),
'dayNamesMin' => $locale->getWeekDayNames(Locale::LENGTH_ABBREVIATED),
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/css/cp.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/css/cp.css.map

Large diffs are not rendered by default.

21 changes: 14 additions & 7 deletions src/web/assets/cp/src/css/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2402,16 +2402,15 @@ ul.icons {
padding-block: 0 !important;
padding-inline: var(--s) !important;
font-size: 12px;
line-height: 22px;
height: 22px;
min-height: 22px;
line-height: calc(22rem / 16);
height: calc(22rem / 16);
}

.btngroup.small,
.btngroup.small input.btn,
.btn.small,
.btn.small + .spinner {
min-height: 22px;
height: calc(22rem / 16);
}

/* big buttons */
Expand All @@ -2433,14 +2432,14 @@ ul.icons {
.btngroup.big input.btn,
.btn.big,
.btn.big + .spinner {
min-height: 36px;
min-height: calc(36rem / 16);
}

/* huge buttons */
.btn.huge {
padding: var(--l);
line-height: 48px;
height: 48px;
line-height: calc(48rem / 16);
height: calc(48rem / 16);
}

/* special buttons */
Expand Down Expand Up @@ -8855,6 +8854,14 @@ body {

.ui-datepicker-title {
text-align: center;

select.ui-datepicker-year {
background-color: hsl(212deg 25% 90%);
padding-block: 0;
padding-inline: var(--xs);
border-radius: var(--large-border-radius);
height: calc(22rem / 16);
}
}

.ui-datepicker-calendar th,
Expand Down