-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Date template for Calendar #3321
Comments
This could also be done by providing a function called This would be same as |
We would also very welcome the ability to highlight (using by an electable background color) some explicitly listed dates or an interval of dates (from min to max) to emphasize the importance of those days (for example a time frame of some event). It doesn't mean that only highlighted dates should be selectable. It should be certainly possible to have other selectable dates in addition to highlighted dates (which have some special meaning and that's why they are highlighted). |
I like the date template actually, we can pass in the date, will try this for 4.1.4. |
@cagataycivici ... I don't exactly understand what you mean by ...
Is it still meant that some dates would be possible to highlight in the calendar component? Thanks for your explanation ... 📆 |
@cagataycivici ... great to see. 🥇 Thanks a lot. |
Hello, |
@vpnocsen this is released in 4.2.rc1. You can see this in action in the showcase. |
Hello, |
@fusionart ... but |
@mlc-mlapis One BIG thank you. You just made me rethink the whole picture and I made it work! Sorry for the spam :) |
@mlc-mlapis Hello bro, can you explain how can we highlight the dates of array? |
@sarojmaharjan99999 ... the template is called on each date ... so just lookup if the date is in your array ...
|
@mlc-mlapis Thanks for the reply but sorry. I still cannot get you. |
@sarojmaharjan99999 ...
|
@mlc-mlapis Thank you for your explanation but I am not able to solve this. |
@sarojmaharjan999 ... here it is ... The principle is showed by using a method which is not optimal from a performance point of view. Finally, some custom pipe should be used to eliminate not necessary calls and run it only once for each cell. |
@mlc-mlapis Thank you so much bro for you time and effort. Finally it works. |
@mlc-mlapis Hello sorry to disturb you once again, there are disabled dates and disabled days features on prime framework but is there any way to achieve enabled dates feature? I have certain dates coming from backend and I only need to enable those dates on calendar. thanks! |
@sarojmaharjan999 ... I don't think so. The logic depends on the number of enabled dates and if the calendar component is suitable to use at all for such a case. You can always combine |
@mlc-mlapis ohh! I actually need to enable the dates that you had highlighted by styling the dates in above stackblitz and disable all other dates. Can you once again edit the stackblitz and enable those 4 dates and disable other days? |
@sarojmaharjan999 ... ah, you didn't understand it fully ... I meant that you could highlight the dates + control via a custom validator what a user can select, so it wasn't directly like |
ohh I see that will be good idea. thank you so much bro! :) |
I'm submitting a ...
[x] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
What is the motivation / use case for changing the behavior?
I recently switched from ngbootstrap to primeng, and everything is great except being able to highlight specific dates in any given week or month in the calendar, e.g. every friday and every monday for the next 2 weeks, then just every monday between 26/7/2017 and 24/12/2017, then nothing after that.
The way this is handled in ngbootstrap is by having a dayTemplate
<ng-template>
which is called for each day, and allows the adding of a style class in the template, so you'd have for example<p-calendar [dayTemplate]="customDay" ...></p-calendar>
and then
and with
isHighlightedDay()
as a method on the class component that the calendar is mounted on, which is called every time a month view is rendered.I know this isn't the way things are handled in primeng, just trying to illustrate with an example what ngbootstrap do, as this is the only functionality from their library that I still have to use after switching over.
The text was updated successfully, but these errors were encountered: