jQuery UI datepicker as "year calendar" - javascript

I'm trying to get a full year calendar from jQuery UI datepicker, where I can interact with weeks rather than days.
I already found how to do the weekly part, but now I would like to display the full year, for a result similar to this :
I managed to add the 12 months, using the numberOfMonths: 12, but how can I set them display as a grid? I tried to set a width to the container, but it doesn't do anything.
For the starting month, I find on an other topic that I can change default date to 1st January adding defaultDate: new Date(new Date().getFullYear(), 0,1). This indeed make the months starting on January, but it also move the current day selection to 1st January... I would prefer, if someone knew a way to keep the current day as default selection.
Then for the previous/next button, is it possible to make them changing year in stead of month ? Else I think I may cheat, by adding an event handler to click 12 times instead of 1.
Finally, I would like to move the next button back to the third month like in the picture. It may not be very hard using CSS, so I'm just curious if there might be a function to do it more easily.
Here's a JSFiddle for my current code http://jsfiddle.net/AVZJh/2553/

I finally found all the missing part, result : http://jsfiddle.net/AVZJh/2625/
Grid & mooving previous/next button was both done changing numberOfMonths to an array : numberOfMonths: [4,3]
Previous/next switching year in stead of month was done adding stepMonths:12
Starting at january without changing default date was done adding showCurrentAtPos: new Date().getMonth()

Why don't you try AnyTime. It has all the features you ask for.

Related

How to show multiple events per day on month view?

Right now, when I add more than 1 event to the calendar, it shows +2. I want to show up to 4 events per day in the month view and then after the 4th event show the +2, +3, etc. If that makes sense. Sorry very new to coding. I am using FullCalendar.io
Thank you so much!
It looks like you have dayMaxEventRows: true set (v5)
or it is set to a specific integer, i.e. dayMaxEventRows : 1
Either remove it or set it to false
dayMaxEventRows: false
on previous versions the setting was named eventLimit

jQuery UI Datepicker - Hide previous navigation arrow for a specific month

I have a simple angular code that opens the jQuery datepicker with a future date (within an angular directive):
scope.StartDate = $filter('date')(scope.BillingDate,'MM/dd/yyyy');
$('#rangeFromSelect').datepicker({maxDate: new Date("10/10/2020")}); // this fires up the datepicker correctly
If scope.BillingDate = 06/12/2018 it shows up the datepicker correctly, but I wish to hide any days before that particular date. My approach to hide the previous navigation works when I do the following:
$('.ui-datepicker-prev').hide();
This works OK until I press the next month and get back to the previous month (ie, the previous navigation button shows up again).
Is there anyway to hide the arrow for that specific month? Or is there a way I could completely disable the dates before the date I mentioned here?
Not sure if I understand the problem correctly but could you use the Min Date Option?
$( ".selector" ).datepicker({
minDate: new Date(2007, 1 - 1, 1)
});

Bootstrap datepicker: Start picking date from year

Normally when selecting dates from immediate vicinity of 'today', default behaviour (picking a day of month) works well but when picking birthdays I want the user to start picking the date from years. I looked at the docs but couldn't find any option to do this. I want the datepicker to open with years selection first. As shown in this picture:
I'm using this plugin: https://bootstrapdatepicker.readthedocs.io/en/latest/
Use startView option (0-days, 1-months, 2-years, see plugin docs):
$('#date').datepicker({
startView:2//
});

Fullcalendar view display goToDate breaks prev, next and today

In my viewDisplay method i have a goToDate method that actually when you click on a day, week or month the calender view go to this specific clicked day with what ever you choose from day. week or month
viewDisplay: function (view) {
var current_clicked_day = $(window).data('cell_date') || new Date();
$('#calendar').fullCalendar('gotoDate', current_clicked_day);
},
and This is working fine, However it breaks all events related to prev, next and today
<>Today
i'm not sure if this is something in my code or a bug in the library
Working Example
For Example
if you click on a day -on the calendar - and then click on Day in the upper right corner and then Today that wouldn't work, plus i don't get any errors in the console
From what I am understanding, you would like to display the agendaDay view when you click on a day in the month or weekAgenda views (http://arshaw.com/fullcalendar/docs/views/Available_Views/)
First of all, viewDisplay has been deprecated (http://arshaw.com/fullcalendar/docs/removed/viewDisplay/) a couple of builds ago. I suggest you update your library.
To achieve what you want you need to call dayClick (http://arshaw.com/fullcalendar/docs/mouse/dayClick/)
Here is a working fiddle based on yours.
I have commented viewDisplay and added the dayClick part just after. http://jsfiddle.net/4bg2B/3/

jQuery FullCalendar select next day?

Using the jQuery plugin FullCalendar, I want the selected date on the calendar to be incremented(by only one day) on a button click event.
This is the code I have been trying using the incrementDate() method:
$('#coolButton').click(function(){
$('#calendar').fullCalendar('incrementDate', 0, 0, 1);
});
This will only work if I increment the year or the month, but never if I increment the day. Any idea how to get the calendar to select the next day?
Thanks
Actually It does increase the selected date by a given amount of time. (in your example by a single day). The thing is you can't see it.
if you click that button may be 30+ times you can see the calender will move to the next month.
(If you change the CSS of the selected date, then you can see it increment)

Categories