2

Has anybody tried manipulating the DatePicker in Joomla? For example, In my datepicker, I am only able to select the date not greater than or equal than the current date, or from the datepicker, based on the current date, I will subtract days. For example, today is March 2, 2015. I will subtract 10 days from it, Maximum selectable date is February 23, 2015.

Does joomla have something to do with this? Or is this achievable in javascript?

I have followed this link from jQuery :

http://jqueryui.com/datepicker/#min-max

I tried this code for the datepicker after reading the guide from the link above but to no avail, it does not work. It's really frustrating. This is a basic functionality that Joomla should have.

jQuery(function() {
jQuery( ".datecalendar" ).datepicker({ minDate: -20, maxDate: "+1M +10D" });
 });
1

There are some options you can control using Calendar.setup. But if you need more customization you will need to create a custom field for that (may be with your own calendar script).

  • is creating a custom field the best option for this? I really just want to limit the minimum and maximum date input. – Break the Law Mar 3 '15 at 1:00
0

I was able to resolve this issue by adding the reference below, and by following this link : http://jqueryui.com/datepicker/#min-max.

But because of this, I cannot use the calendar type as the form field for my date fields. I need to use "text" as their type.

https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js">

I used one of my fields as an example, and it worked. except it was using a different UI Calendar than joomla's default calendar

<script>
jQuery(function() {
jQuery("#jform_start_date").datepicker({ minDate: -20, maxDate: "0" });
 });
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.