I have hard time clicking the slot I want in Fullcalendar using Nightwatch.
All I have is:
await browser.click('css selector', 'td.fc-timegrid-slot.fc-timegrid-slot-lane')
which surprisingly (in timeGrid view type) click on the Thursday weekday where I want Monday or any other day (ergo: I want to be able to control it).
How to do it?
Related
I'm using the standard FullCalendar Events(as a json feed) and have everything working fine...almost.
var calendar = new Calendar(calendarEl, {
events: '/myfeed.php'
});
My initial view is a 'dayGridMonth' so the FC default behavior is to only retrieve the events for that month by appending the startParm/endParam querystring.
This is not what I want.
On the backend of this request, I'm currently sending the entire calendar feed (ignoring the start/end params) so I don't have to keep hitting my AJAX '/myfeed.php' page every time somebody clicks on "Next" to view the next month.
However, I can't get FullCalendar to know that it already has the whole json feed and not to bother getting anything else - just show the next month from the data we have. I've played around with lazyFetching but that seems to force that it goes to the AJAX call every time.
Any ideas on how I do this?
Thx!
I'm using https://fullcalendar.io/ library. I use it for week view. On datesSet or even dayHeaderDidMount callback when clicking on next arrow to go to next week the argument comes as expected, but then it is triggered again with the current week date as argument. Does anybody know why and how can I make this come back with the desired week as argument?
Thank you!
I am trying to use Fullcalendar in AngularJS.
I somehow implemented the calendar and it works (saves data to the SQL).
However, if I click on the day in the calendar, the modal pops up and the start date shows 00:00:00 in time aspect.
My questions is how can you set the time for the hour of current time?
If it is 9AM currently, then, how can the time in the start initialize the time as 09:00:00 ?
This is what I have for the coding.
select: function(start, end) {
$('#ModalAdd #start').val(moment(start).format('YYYY-MM-DD HH:mm:ss'));
$('#ModalAdd #end').val(moment(end).format('YYYY-MM-DD HH:mm:ss'));
$('#ModalAdd').modal('show');
}
I have a feeling that it would be nice to somehow modify the code below and place it within the above code, but I am stuck on where to put it.
var time = new Time();
var h = date.getHour();
I don't know it the Time() even works (it was Date() from other source).
Please can anyone help me on initializing the hour in the Fullcalendar based on the current hour? I am looking for any advice or even a hint to solve this matter.
Thank you in advance!
You can use momentJS to add the current (local) system time to the selected day:
select: function(start, end) {
var today = moment();
start.set({ hours: today.hours(), minute: today.minutes() });
$('#ModalAdd #start').val(start.format('YYYY-MM-DD HH:mm:ss'));
$('#ModalAdd #end').val(end.format('YYYY-MM-DD HH:mm:ss'));
$('#ModalAdd').modal('show');
}
See https://momentjs.com/docs/#/get-set/set/
Also it's worth mentioning that start and end are already moments, so you don't need to wrap them in the moment constructor again as you were doing before.
Another thing to consider if you do this, is whether your calendar has other views available, in particular the agenda-style views, on which selections can be made which would trigger the modal? If so, then you need to ensure that the time-manipulation code above only runs when the view is "month", because the agenda view will, by default, already use the time that the user actually chose on the calendar.
I'm working with the JFXtras Agenda (http://jfxtras.org/) and trying to implement the following:
when you drag a specified Object (from a TableView) to the Calendar, it should make a new Appointment on the timeframe where you drop it. This new Appointment should then be linked with the Object that was dragged.
What I've got now is a simpler variant where I make a new Appointment onDragDropped with the time values of the displayedCalendarProperty:
AppointmentImpl presentation = new Presentation(customObjectFromTableView)
.withStartTime(new GregorianCalendar(lAgenda.getDisplayedCalendar().YEAR, lAgenda.getDisplayedCalendar().MONTH, lAgenda.getDisplayedCalendar().DATE, lAgenda.getDisplayedCalendar().HOUR, lAgenda.getDisplayedCalendar().MINUTE))
.withEndTime(new GregorianCalendar(lAgenda.getDisplayedCalendar().YEAR, lAgenda.getDisplayedCalendar().MONTH, lAgenda.getDisplayedCalendar().DATE, lAgenda.getDisplayedCalendar().HOUR+1, lAgenda.getDisplayedCalendar().MINUTE))
.withSummary("Summary")
.withDescription("A much longer test description")
.withAppointmentGroup(new Agenda.AppointmentGroupImpl());
lAgenda.appointments().add(presentation);
As you can see the class Presentation simply extends AppointmentImpl. It seems that a new Presentation is made, but on a totally wrong date (e.g. 0001-03-05 10:12 as start date).
Is it possible to make this new Presentation starting on the timeframe where it's dropped? And if not, how could I fix the above code so that the Presentation is made in the given timeframe in stead of in the year 0001?
Edit: I figured this date is the earliest date possible. I guess I'm not setting the appointment's date right then?
Sorry for the late reaction; I was not monitoring stackoverflow for issues.
It would be great if you could email me a small stand alone example, so I can see what is going on.
Is it possible to go to the start of an event based on an external link.
Example...
<li>Tuesday 10/8/13 10:00 am</li>
<li>Tuesday 10/8/13 1:00 pm</li>
<li>Tuesday 10/8/13 2:00 pm</li>
Upon clicking one of these links, i'd like to have my FullCalendar implementation scroll to that date/time.
Similar to the way this works, only going to the day/time of an event
$('#button').click(function() {
$('#calendar').fullCalendar('today');
});
You can use FullCalendar's gotoDate method. You'd just need to pass in the date parameters in the correct format.
.fullCalendar( 'gotoDate', year [, month, [ date ]] )