Giter Site home page Giter Site logo

Comments (13)

jwgmeligmeyling avatar jwgmeligmeyling commented on July 23, 2024

With the code example I gave in reply to that question you should be able to do this? #12 (comment)

There is one side note though, since you want to remove the old events. You can remove these by setting the length of the array to 0, so call eventsArray.length = 0 before pushing new objects to the array.

from jqm-calendar.

jwgmeligmeyling avatar jwgmeligmeyling commented on July 23, 2024

BTW, hHas there been a blogpost about this calendar or something? There is a reasonable amount of activity in this repository lately 😄

from jqm-calendar.

alezzzzz avatar alezzzzz commented on July 23, 2024

It works :D

Hehe not really, maybe Im just being annoying this last couple of days ;-)
I dont know why that didnt work before but I tried all ways possible!!! I was resettign the array using *eventsArray = [] * and that didnt do anything grrrr

Thanks for the prompt reply !!!

from jqm-calendar.

jwgmeligmeyling avatar jwgmeligmeyling commented on July 23, 2024

Hehe no not just you, have had some forks and stars as well ^_^

But great that its working now. It didn't work because when you do eventsArray = [] you initialise a new array, and let the eventsArray variable reference to that. Internally, however, the calendar instance still refers to the old array (it doesn't even know the variable eventsArray exists).

When you use the eventsArray.length = 0 method, you alter the same array instance as the one the calendar uses. It's a bit of a hack and it's quite sad that Javascript doesn't provide a way to clear an array (or even delete one element - split creates a new array as well).

from jqm-calendar.

chandrima14 avatar chandrima14 commented on July 23, 2024

very nice post jQM Calendar
but i am facing problem is that
how to disable previous date from current date.
suppose current date 05/06/2014(dd/mm/yyyy)
disable 05/06/2014 previous date to onwards

from jqm-calendar.

jwgmeligmeyling avatar jwgmeligmeyling commented on July 23, 2024

Try something like this at line 110 in the addCell($row, date, darker, selected)-function:

         var $td = $("<td class='ui-body-" + plugin.settings.theme + "'/>").appendTo($row),
             $a = $("<a href='#' class='ui-btn ui-btn-up-" + plugin.settings.theme + "'/>")
                  .html(date.getDate().toString())
//                .click(cellClickHandler)  <-- comment this one out, you want to prevent click handler
                  .data('date', date)
                  .appendTo($td);

         // Compare the date for this cell with today (stored as a variable in the plugin scope)
         if ( date.getTime() >= today.getTime() ) {
                  $a.addClass("darker"); // It looks disabled
         } else {
                  $a.click(cellClickHandler); // Click handler should work for enabled dates;
         }

from jqm-calendar.

chandrima14 avatar chandrima14 commented on July 23, 2024

very nice post jQM Calendar
my question is that
suppose today date is 06/06/2014(dd/mm/yyyy)
disable previous date from today date
my calendar look like this
chec
suppose if user select date from calendar 27/06/2014(dd/mm/yyyy)
my calendar look like this (this is the check in date)
s_check
check out date starts from 28/06/2014(dd/mm/yyyy)
my calendar look like this
o_check
27/06/2014 previous date will be disabled how to possible?please reply

from jqm-calendar.

jwgmeligmeyling avatar jwgmeligmeyling commented on July 23, 2024

Ah I thought you wanted to disable the past dates instead of disabling the days before a specific (selected date). Change the today variable to a variable that stores the selected date:

if ( date.getTime() >= selectedDate.getTime() ) {  // Not today
    $a.addClass("darker"); // It looks disabled
} else {
    $a.click(cellClickHandler); // Click handler should work for enabled dates;
}

from jqm-calendar.

chandrima14 avatar chandrima14 commented on July 23, 2024

My question is that today date is 09/06/2014(dd/mm/yyyy)
user can not choose these dates like 08/06/2014,07/06/2014,06/06/2014,......30/05/2014...

from jqm-calendar.

jwgmeligmeyling avatar jwgmeligmeyling commented on July 23, 2024

Above answers do still hold, if you want further support please supply a JSFiddle.

from jqm-calendar.

chandrima14 avatar chandrima14 commented on July 23, 2024

please visit this site
http://www.nogray.com/example.php?ID=286
this type of calendar need.
please replay me as soon as possible

from jqm-calendar.

chandrima14 avatar chandrima14 commented on July 23, 2024

please visit this site
http://www.nogray.com/example.php?ID=286
and
http://jsfiddle.net/SirDerpington/PPSh3/3/
how to apply jQM Calendar?
please replay as soon as possible

from jqm-calendar.

jwgmeligmeyling avatar jwgmeligmeyling commented on July 23, 2024

The examples are using jQuery UI, why not use that. Please ask further questions at stack overflow, I'm going to lock this issue now.

from jqm-calendar.

Related Issues (20)

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.