I'm looking for a way to get the current pagedate. I know how to get the original config or even how to subscribe to changePageEvent and get it while scrolling, but neither covers a case when someone opens the calendar scrolls through few months and then closes and re-opens, I need the pagedate for that page. There has to be a property that records that, but can't find in the API.
Here is an example of a popup calendar that remains on the last calendar page viewed, even if a date isn't selected. Browse to a month and close the calendar using the "x" in the corner. When you click the button to display the calendar again you'll find it's on the same page you last navigated to:
Calendar Control: Popup Calendar - Basic
I don't see any code in the example source code that sets the date, so in the absence of your source code I'll have to guess that you're instantiating a new calendar each time you show it.
To get the month/year displayed use the pagedate property.
Related
I have implemented the fullcaleandar in angular and it is working fine. Usually the prev / next click will update the month/day/week views based on which tab is currently active. But I have custom buttons to increment or decrement week and day values. So I am trying to update the month alone in the fullcalendar prev and next buttons irrespective of the active view tab. ( only because I have other buttons to control the day/week views)
That means even if the calendar is in day/week view, if I am clicking the Fullcalendar next/prev buttons, the month value should increment/decrement -- not the day/week value.
Iam thinking about any option to send month data to the inbuild calendar api which is triggered while calling prev/next ? Is it possible to do so as per fullcalendar methods ?
Thanks.
It is actually not possible until you try rewriting some part of FullCalendar Code. The Fullcalendar documentation suggests that increment and decrement depends on the current view. Ideally, the use case (even the API provided by FullCalendar) suggests that, If month is the view then, 1 month is incremented. If is a week view, 1 week in incremented. You may try finding some workarounds but, I don't think there are any.
One suggested workaround is to:
Get the current date FullCalendar is displaying
Get the current View ('timeGridDay', etc.)
Then use the changeView method by incrementing the dateOrRange object
I'm working on a project where the user has to be able to add or edit hours that he will work or worked. The dataset I'm using for this I retreive from ASP.net / MVC 4. What is the best way to check if the user added new data to the table or edited some data?
Example: The user loads the page, the calender is set to the current date --> table shows 3 weeks. Previous week, this week and next week. The dataset load in the hours that were retreived from ASP.net. The user adds new hours and edits some hours. Then the user clicks on the button to go to the next week. The data entered by the user has to be compared with the retreived dataset. The dataset has to be saved, this will happen in ASP.net. But after the save the browser gets the data of the next week and the calendar has to be for the next week.
The data added / edited by the user has to be saved but I have to know if this is edited or added. What is the best way to do this?
The retreived dataset = a string? Could I compare this by just comparing 2 strings? remove enters, spaces, ...
Is there a library to compare datasets in jquery?
To show the next week I think the page cannot be refreshed? Correct?
Any other suggestions are welcome.
I'm not quite sure on what you're going at here, however a suggestion might be to either have a save button on each page or hook up a event for whenever the input looses focus (or whatever you're using for selecting hours etc).
For the latter suggestion it would require more javascript, for example each input that's rendered could have data attributes of which year, month, and day it represents so it can be used when posting a change.
If you however prefer to submit the whole "dataset", you should checkout modelbinding if you're not already fimiliar with it, then either post the collection when clicking save or changing page.
Scott Hanselmans article on how the default modelbinder works might be of any help.
I'm working on a php-html-javascript project and I'm really going crazy with this problem.
The project uses jquery datetime picker and everything is fine (the datetime picker works on other pages and also in the "affected ones"), but when I'm trying to use it on a dynamically created element the date time picker loses interactivity: can't click it or change year/month, it only closes when there's a click on another element. It doesn't even trigger the "onSelect" event so I can't use it.
OTHER INFORMATIONS:
- The div associated is in the page (DOM element) but is cloned as a new div ($.clone())
- The datetime picker is associated with the element when the div is fully created (callback), so there is no possibility of not-loaded element
- The datetime picker displays on click but isn't interactive.
I tried for days but I can't solve this. Hope you all can help... Thanks!
As far i know the problem is occurring because of clone.If we use clone with true as the argument then the events and properties associated with the old element copies to cloned element. May be when you click on the calendar check whether the date is been displayed on the first text box. If it is so then there must be problem with the cloning.
I've got a fullcalendar setup, but there are so many pages I've got it set up with tabs, but when I change a date, only the ones currently displayed get updated, the same goes for the initial loading of calendars, it will only load the events for the displayed ones, while the "hidden" ones in inactive tabs don't' get populated at all.
I at first couldn't even get a calendar view going, but I solved this by initiating the $.tabs AFTER the fullcalendar construction was done.
I have a live copy running right now at http://www.stavanger-ishall.no/ (hitting the blue time schedule image should open it for you)
I have attempted working around the problem by adding an event to the "select" option of the tabs to fetch the calendar data then, but to no avail.
The solution was to use the $.tabs() "show" event as opposed to "select" and then running a fetch command on my calendars, this ensured the page had loaded the calendar before trying to populate it.
I am using Selenium to test out a web site. The web site contains a date field, which when clicked, opens a popup from wherein I can choose the date.
My issue is that I wish to select a particular date using the Selenium IDE or Selenese. I have tried various methods, but have not been able to get a correct solution or been able to resolve it, except by manually specifying a date to the field in Selenese script. I am using Java to implement the test case.
An example could be checked by going to any airlines site and clicking on the date field for departure. The popup which comes up, I wish to capture a date on that. This could be a future date or the present date.
You need to implement some code that will navigate calendar to the desired date. Depending on the calendar appearance it may be required to navigate to the next month or year, so you need the code that will determine what needs to be done and then emulate required events for Selenium.
We had the same task in our tests and we end up with either selecting today's date or by entering the date into the field directly. We also made a code that will allow to select any date on the calendar by we did this only because we needed to test the calendar widget and we were the authors of the widget so we knew how it was made. However it resulted in writing a lot of code
Selenium IDE is limited in its ability to handle javascript. I've worked around it at times
by putting custom links in that do customized GETs, but it's a hack.
You could look at Sahi, which can do it. I haven't tried it though.
http://sahi.co.in/w/