I am using Angular UI Calendar to display some events on the calendar. Whenever the calendar is loaded for the 1st time, the events extend to next date or shown on some other Date.
However when I change the View(Day/Week) and come back again to Month view, then events are displayed fine. Similarly, after changing month and coming back again to the current month , the events are displayed correctly.
Also, I've noticed that the calendar height also increases by 95px after changing the view(when displayed correctly).
Why is this occuring. How can I render events correctly for 1st time?
The problem was with CSS. Solved it.
Related
I am currently working on a project where the given user needs to fill out a form to add an activity. There is a filter which selects which month this applies to. There is a calendar where a date is selected from. The issue is that the calendar works properly when the current date is in the selected month as such:
The current month popup view
The current month filter
But when the filter is applied to a month that isn't the current one, the view lacks behind as such:
The current month filter
The error full popup
I have tried the use of the active start date yet, I can't seem to ensure that the active start date is applied for the month. Are there any known solutions? I have my code snippet attached below:
Code of the parameters
Code of the React Component Returned
The date is given by another component which is updated with the use state according to the filter applied.
I have an angular uib datepicker that works fine when selecting dates, but now I need something else from it.
I would like to be able to call a function when the user navigates through the month/year menu.
Until now, the datepicker only reacts when a day is selected (the ng-model changes, ng-change is called etc etc). I want to call a function when the user uses the top menu and he/she didn't click on a day yet. Just going from one month to another, either with the arrows or with the month/year selector, I would need to call a function.
Is there any way to do it? I can't figure it out.
Appreciate it.
We finally figured it out.
Using a decorator (that we learned from here Angular Bootstrap Datepicker change month event) you can throw a function when the month or the year is changed in a datepicker.
Does anyone have a solution to updating angular ui's disabled dates from a server response?
https://github.com/angular-ui/bootstrap/issues/779
You should create another directive that will require datepicker's controller. From your
directive you should call the refreshView of the datepicker to reevalute the disabled dastes.
Does anyone have example code for that?
I'm trying to use angular ui datepicker so that the disabled dates are read from a server response. I change the datepicker's min date to force it to refresh.
I saw another stackoverflow page where the user had it refresh, but it relied on the datepicker calendar being clicked. Another one used set the date min attribute as the value of another field.
For me, I have a completely separate field from the date picker. When changed, it sends an http request to the server, and on a successful response the available dates are updated.
The only problem with changing the min date to force a refresh is that sometime's there same but with different dates to disable. I'm looking into changing a datepicker option I do not use to a random value to force a refresh.
Does anyone have a better way? I saw cross controller communication via a service, but this is a different module. I also saw a github issue where the datepicker controller can be
I've found a simple solution to this problem using a decorator: https://gist.github.com/cgmartin/3daa01f910601ced9cd3
Then, you only need to call $scope.$broadcast('refreshDatepickers') to refresh the datepickers.
IMPORTANT: For more recent ui-bootstrap datepicker library, you may need to replace 'datepickerDirective' with 'uibDatepickerDirective' if you are using datepicker with uib-datepicker element or attribute.
The angular bootstrap datepicker has datepicker-options
This user listed the solution: https://github.com/angular-ui/bootstrap/issues/2189#issuecomment-225685104
bogdandrumen commented on Jun 13
Use datepicker-options="{minDate: yourScopeMinDate}"
which worked for me. I have two pickers, the second picker cannot be greater than the first one so if the first picker changes, the second picker's max date also changes.
I imported a couple thousand events into Drupal 7 Events content type. They're all published and I can view each event individually. But, in the Month view, only events from the current month are appearing. If I click through to other months, nothing appears.
I just realized it's doing this for other views also (week and day).
I'm guessing that I have some type of filter set incorrectly or something. Any ideas?
Winforms 2.0. Stick a DateTimePicker on a form. It defaults to TODAY. Click on the dropdown arrow to show the Calendar, and click on TODAY. The ValueChanged event DOES FIRE, even though it is already set to today.
What i would like to do is replicate this same functionality - I would like to reset it (in code) to today, and next time i click on today via the Calendar i want that ValueChanged event to fire (just like it did the first time).
If the above is not possible, i want some event that always fires whenever i pick a date on the Calendar (regardless if there is a change or no change).
Sounds really simple, surely someone has the answer?
What you're seeing there is a side-effect of the fact that DateTimePicker stores the time component of its value as well as the date.
So when your form first initializes, the DateTimePicker is being initialized with DateTime.Now. When you then select "Today" from its drop-down calendar, you're changing the value to DateTime.Today.
If you don't care about the time component and/or you're always reading the value as dateTimePicker1.Value.Date, then you could initialize the control in code with DateTime.Now and the ValueChanged event will fire when the user selects Today from the calendar. Otherwise you might consider catching the CloseUp event, which is fired whenever the calendar control is closed (regardless of whether the value changed).
Im not a win form programmer, but see if there is a Day_Render event.
That should fire for each day...at least there is one for web based development, but I would think it is the same. So look for Render() event.