-
Notifications
You must be signed in to change notification settings - Fork 477
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
feat(core): PrimitiveCalendar
add ability to change the color of the days
#2904
Conversation
Pull request was closed ✔️All saved screenshots (for current PR) were deleted 🗑️ |
BundleMonFiles updated (2)
Unchanged files (3)
Total files change +212B +0.03% Groups updated (1)
Final result: ✅ View report in BundleMon website ➡️ |
Visit the preview URL for this PR (updated for commit a82758d): https://taiga-ui--pr2904-calendar-days-color-krc3gv5e.web.app (expires Thu, 20 Oct 2022 10:18:42 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 4b5ece1e114386f6a105425ef799091475b249eb |
Codecov ReportBase: 67.26% // Head: 61.75% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2904 +/- ##
==========================================
- Coverage 67.26% 61.75% -5.51%
==========================================
Files 748 1465 +717
Lines 9427 17333 +7906
Branches 1316 2351 +1035
==========================================
+ Hits 6341 10704 +4363
- Misses 2862 6191 +3329
- Partials 224 438 +214
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
8dcd28d
to
d14c79a
Compare
projects/core/components/primitive-calendar/primitive-calendar.template.html
Outdated
Show resolved
Hide resolved
projects/core/components/primitive-calendar/primitive-calendar.template.html
Outdated
Show resolved
Hide resolved
7deb39f
to
d6fc24f
Compare
I think it would be good to leave the weekend markers in here and allow locales to determine what the weekends are. Consider switching from a locale where the workweek goes from Mon -> Fri, to a locale where it's Mon -> Sat. |
I'm not sure, what if somebody wants to color Saturdays and Sundays differently? I'm not sure there's a real use case for that, but more freedom in this case could be good. |
I would say keeping the distinction between weekdays/weekends is good because it's fairly common to want to know that for business apps. It's a pretty reasonable default to at least mark those cells as such. On top of that, is it possible to allow users to decorate cells with data attributes? For example, if I could pass some function: const decorate = (d: Date) => {
const attrs = [];
if (isWeekendDay(d)) {
attrs.push('weekend');
}
if (isPublicHoliday(d)) {
attrs.push('holiday');
}
if (isSomeonesBirthday(d)) {
attrs.push('birthday');
}
return attrs;
} The underlying cell would then have |
projects/core/components/primitive-calendar/primitive-calendar.template.html
Outdated
Show resolved
Hide resolved
474d18a
to
58a33ce
Compare
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #2606
What is the new behavior?
Does this PR introduce a breaking change?