Tagged: datepicker
-
AuthorPosts
-
January 2, 2017 at 11:51 am #728462
Hi!
I would like to disable past dates in the datepicker so users can’t select them. Could you please help me with this?
I have been working with Enfold for a few months and I think it is amazing! however I am not too experienced in CSS. Could you give me some advice on how to best solve this?
Thanks a lot!January 2, 2017 at 12:43 pm #728483Hey robertruedam,
We would definitely recommend you to use a child theme – http://kriesi.at/documentation/enfold/using-a-child-theme/ in order to avoid applying the same changes each time you update the theme.
Please copy unmodified enfold/framework/php/class-form-generator.php file and paste it inside enfold-child folder and find following at the top and remove it (please do not remove PHP opening tag)
if ( ! defined( 'AVIA_FW' ) ) exit( 'No direct script access allowed' );
and then add following code to Functions.php file of your child theme
require( 'class-form-generator.php' );
Then open class-form-generator.php file in your child theme and find
class avia_form extends aviaFramework\base\object_properties
and change it to:
class avia_form //extends aviaFramework\base\object_properties
Then, find the following line:
echo 'jQuery( function(){ jQuery(".avia_datepicker").datepicker({
then add the following right below that line
minDate: 0,
Best regards,
Yigit- This reply was modified 11 months ago by Yigit. Reason: Updated the instructions
January 3, 2017 at 8:44 am #728875Hi Yigit, thank you so much for the fast reply.
I followed your indications but it doesn’t seem to make any difference.
Also, I am indeed using a child theme. Is there anything I missed?
Thanks in advance,
Robert
January 3, 2017 at 1:33 pm #728973Hi,
Can you please post FTP logins here privately as well so we can look further into it? :)
Best regards,
YigitJanuary 4, 2017 at 6:04 am #729280Hi Yigit,
I found out yesterday that my booking engine partner is using a plugin (WP Datepicker) for the calendar and I couldn’t see it, i’m sorry.
The plugin author advised me to modify the plugin adding a snippet from jQuery website, but nothing specific so I’m still trying.I don’t know if this is something you guys can help me with although I would appreciate it if that’s possible
Thank you for the support, You guys are fast!
Rob.
January 4, 2017 at 1:36 pm #729392Hi,
It does work fine. You are using a plugin to display datepicker on your frontpage.
I created a private test page and deactivated your plugin and it did work fine.
Please review your website now and contact plugin authors if you would like to apply the changes on their plugin :)Best regards,
YigitFebruary 25, 2018 at 12:54 pm #917352Is this the right code to make it invisible?
#top .avia-datepicker-div.ui-datepicker .ui-datepicker-prev {
left: 2px;
display: none;
}Thanks Yigit
February 25, 2018 at 7:15 pm #917519Hi,
Yes, if that works it should work out for you also!
Have you tried it and you are having issues?Best regards,
BasilisMay 19, 2018 at 1:00 pm #959047Dear Team,
with
minDate: 0,
in class-form-generator.php after
echo ‘jQuery(document).ready(function(){ jQuery(“.avia_datepicker”).datepicker({
calendar works well with the previous dates disabled but…
the date field can be manipulated manually (it is possible to write the date without choosing the day from the calendar).
is there a way to not allow to write manually in the date field?
Otherwise everything is useless if the user can manually correct the date…
Thanks in advance
Lion- This reply was modified 6 years, 6 months ago by lion73.
May 20, 2018 at 10:26 am #959385Hi Lion,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
VictoriaMay 22, 2018 at 8:28 am #960185“Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)”
Dear Victoria, this is not a customization…date field that can be manipulated manually it’s something comparable to a bug.
It is clear that you are not able to solve the problem.
UPDATE: problem solved by adding a very small piece of code!
Victoria…shameful support service.- This reply was modified 6 years, 5 months ago by lion73.
May 22, 2018 at 2:28 pm #960370Hi,
@lion73 Glad you figured it out! Adding “readonly” attribute to input tag should disable manual entries.
Sorry for the experience. While we normally do not mind helping with small customizations, we try to keep them to minimum when forums are busy. And after recent updates, forums are currently busy :)Hopefully we will be able to change your thoughts about our support in future :) I am closing this thread for now. If you have any other questions or issues, please feel free to start a new thread under Enfold sub forum!
Best regards,
Yigit -
AuthorPosts
- The topic ‘Disabling past dates in datepicker’ is closed to new replies.