Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to check the jqm calendar date have event or no event in jquery mobile?
    text
    copied!<p>Hi I am new to jquery and jquery mobile I am attending to create an event calendar using following <a href="https://github.com/JWGmeligMeyling/jqm-calendar" rel="nofollow">JQM-Calendar</a>.Now i want to check this date have event i display the message </p> <blockquote> <p>The Date have an event </p> </blockquote> <p>or the date have no event i display the message as </p> <blockquote> <p>There is no event on this date</p> </blockquote> <p>. How can I check this in my code</p> <p>Here is My code:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;My Page&lt;/title&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" /&gt; &lt;link rel="stylesheet" href="jw-jqm-cal.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jw-jqm-cal.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).on('pageshow', "#view-calendar", function(event, ui) { var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); $("#calendar").jqmCalendar({ events: [{ "summary": "Meet PM", "begin": new Date(y,m, 27 ), "end": new Date(y, m, 28) }, { "summary": "Dinner", "begin": new Date(y, m, d + 3), "end": new Date(y, m, d + 4) }, { "summary": "Lunch with Friends", "begin": new Date(y, m, d + 6), "end": new Date(y, m, d + 7) }, ], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], days: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], startOfWeek: 0 }); $("#calendar").bind('change', function(event, date) { $("#message").html('&lt;p&gt;&lt;strong&gt;There is No event at '+date+' &lt;/strong&gt;&lt;/p&gt;'); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role="page" id="view-calendar"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;Tradition Calendar&lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;div id="calendar"&gt;&lt;/div&gt; &lt;div id="message"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p></p> <p>In this way I find the which date have event and display the message.This way how to check the other date have no event </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload