Using Customized Jquery DatePicker

Using Customized Jquery DatePicker

arunjaykrishnanarunjaykrishnan Posts: 11Questions: 2Answers: 0

Hi,

We have a requirement to display customized jquery datepicker. This date picker is required to highlight certain dates.
We are using the following code to achieve this:
$('#datepicker').datepicker({
beforeShowDay : highlightDays, //function to highlight days
showOtherMonths : false,
numberOfMonths : 1,
dateFormat : "ddMyy",
});

We tried with custom fields but on clicking on the calendar the inline date field closes without setting the selected value and getting a jquery error saying the object does not exist. Please help.

Thanks,
Arun

Answers

  • tangerinetangerine Posts: 2,115Questions: 15Answers: 233

    Questions about the jQuery datepicker should be addressed to a jQuery site. You don't appear to be using DataTables' Editor datepicker.

  • arunjaykrishnanarunjaykrishnan Posts: 11Questions: 2Answers: 0

    Data table provides an option for using jquery's data pickers also in the example provided. But if we customize the datepicker like the example I mentioned above. It doesn't seem to work. Also does datatable date picker provide option for highlighting certain dates and disable certain dates. Also does it provides the tool tip functionality when mouse over a date in the calendar?

  • allanallan Posts: 47,445Questions: 1Answers: 6,736 Site admin

    I assume you are using Editor? If so, the date input type will automatically detect if jQuery's DatePicker library is present and then use that.

    You do not need to create your own instance of the DatePicker - Editor will do it for you.

    If you could show your code, or even better a link to a test case, that would be useful.

    Allan

  • arunjaykrishnanarunjaykrishnan Posts: 11Questions: 2Answers: 0

    Hi Allan,
    When I used the date field instead of datetime, I was able to get the highlighted dates as desired. Thanks for the suggestion!!
    How ever I faced one issue though. The editor submit was happening before date selection. I am handling this issue by using a flag (javascript variable) which get set on beforeshow of calendar and reset and submit editor on close of calendar. I then used this flag in the preSubmit event handler to return true only if the flag is reset (calendar is closed). As such my issue is completely fixed. Do let me know if there is any other straight forward option.

  • allanallan Posts: 47,445Questions: 1Answers: 6,736 Site admin

    What version of Editor is it you are using? Are you able to give me a link to the page showing the issue so I can take a look?

    Thanks,
    Allan

Sign In or Register to comment.