admin管理员组文章数量:1293916
I am using full calendar api for my application ,I am trying to disable the past dates in the fullcalendar ,but I am getting $.fullCalendar.formatDate
is not a function error.I am posting my code
select : function(start, end, allDay) {
$('#clickedDateHolder').val(start.format());
// show modal dialog
var check = $.fullCalendar.formatDate(start,'yyyy-MM-dd');
var today = $.fullCalendar.formatDate(new Date(),'yyyy-MM-dd');
if(check < today)
{
bootbox.alert("Past Dates")
}else{
input.push(date.format());
$('#selectedDate').val(input);
$('#event-modal').modal('show');
So in this code I am trying to see which date is past date in fullcalendar and trying to give a message of that but each time I am getting this error.Somebody please help
I am using full calendar api for my application ,I am trying to disable the past dates in the fullcalendar ,but I am getting $.fullCalendar.formatDate
is not a function error.I am posting my code
select : function(start, end, allDay) {
$('#clickedDateHolder').val(start.format());
// show modal dialog
var check = $.fullCalendar.formatDate(start,'yyyy-MM-dd');
var today = $.fullCalendar.formatDate(new Date(),'yyyy-MM-dd');
if(check < today)
{
bootbox.alert("Past Dates")
}else{
input.push(date.format());
$('#selectedDate').val(input);
$('#event-modal').modal('show');
So in this code I am trying to see which date is past date in fullcalendar and trying to give a message of that but each time I am getting this error.Somebody please help
Share edited Oct 29, 2015 at 11:15 Java_User 1,3213 gold badges27 silver badges38 bronze badges asked Oct 29, 2015 at 10:26 SubhoSubho 9235 gold badges25 silver badges49 bronze badges 4-
Have you tried
$.fullCalendar().formatDate()
? It's probably a function. – Robin Dorbell Commented Oct 29, 2015 at 10:29 - post the console error and html code also – Akhilesh Singh Commented Oct 29, 2015 at 10:30
- TypeError: $.fullCalendar.formatDate is not a function – Subho Commented Oct 29, 2015 at 10:31
- 1 stackoverflow./questions/24729721/… – Robin Dorbell Commented Oct 29, 2015 at 10:32
2 Answers
Reset to default 9FullCalendar's formatDate() was only for versions below 2.0. See here: http://fullcalendar.io/wiki/Upgrading-to-v2/
$.fullCalendar.formatDate → use a moment's .format() method instead
So instead of
$.fullCalendar.formatDate(start,'yyyy-MM-dd');
you have to use
moment(start, 'DD.MM.YYYY').format('YYYY-MM-DD')
whereas 'DD.MM.YYYY'
is the recent format of start
and format('YYYY-MM-DD')
specifies the target format. Pay attention, you need to use capitalized letters.
your scripts might be conflicting with some other scripts, try adding all your code inside this instead of $(document).ready()
jQuery.noConflict();
(function( $ ) {
$(function() {
// your code
});
})(jQuery);
本文标签: javascripthow to solve fullCalendarformatDate is not a functionStack Overflow
版权声明:本文标题:javascript - how to solve $.fullCalendar.formatDate is not a function - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741591240a2387140.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论