Coder Social home page Coder Social logo

kyleleneau / jmonthcalendar Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 11.0 1.13 MB

jMonthCalendar is a full month calendar that supports events written as a jQuery plugin, supports drag and drop and multi day events.

Home Page: http://www.bytecyclist.com/projects/jmonthcalendar

License: Other

JavaScript 100.00%

jmonthcalendar's People

Contributors

kyleleneau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jmonthcalendar's Issues

Unusual behaviour when no URL parameter

I have an application where I just want to process an event click in
javascript. In that the URL component is blank. If I do this when
clicking an event the browser scrolls upwards.

To fix this I changed the javascript to not add the href attribute when a
URL value is blank:

var link = "";
if (event.URL.length > 0){
link = jQuery('' + event.Title + '');
}else{
link = jQuery('' + event.Title + '');
}

onDayCellClick date

What steps will reproduce the problem?

  1. View demo for 1.3.0 beta
  2. Click on a day

What is the expected output? What do you see instead?
Alert will display the last day of the month instead of the day that was
clicked

What version of the product are you using? On what operating system?
1.3.0 beta

Please provide any additional information below.
1.2.2 is working correctly

//DateBox Events
var dateLink = jQuery('

').click(function(e) {
defaults.onDayLinkClick(new Date($(this).parent().attr("date")));
e.stopPropagation();
});

        var dateBox = jQuery("<td></td>").attr(atts).append(dateLink).dblclick(function(e) {
            defaults.onDayCellDblClick(new Date($(this).attr("date")));
            e.stopPropagation();
        }).click(function(e) {
            defaults.onDayCellClick(new Date($(this).attr("date")));
            e.stopPropagation();
        });

Think that gets it.

When clicking a day cell the date passed to onDayLinkClick is incorrect.

What steps will reproduce the problem?

  1. Add this to the jscript options for the calendar:
    onDayCellDblClick: function(dateIn){
    alert(dateIn.toLocaleDateString());
    return false;
    },
  2. Double click an empty date on calendar.

What is the expected output? What do you see instead?
Expected: The date of the day clicked.
Actual: The last date in the calendar

What version of the product are you using? On what operating system?
1.3.0 Beta

Please provide any additional information below.

*** POTENTIAL SOLUTION ***

This bug occurs because of variable scope. In JMonthCalendar there is a
loop which loops between the cells to render the days. At the start of the
loop the current date is set:
Line 297: var currentDate = _dateRange.startDate.clone().addDays(i);

Then later on the double click function is set:
var dateBox =
jQuery("").attr(atts).append(dateLink).dblclick(function(e) {
defaults.onDayCellDblClick(currentDate);
e.stopPropagation();

However the date passed is the date from the loop, which is ok for
rendering elements but not ok when the actual date is clicked because it
currently uses the last value currentDate was set to, which is the last day
on the visible calendar. To fix this the date needs to be extracted from
the element that initiated it by parsing this value:

$(this).attr('date')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.