slykereven Posted February 22, 2017 Share Posted February 22, 2017 Hello everyone, I want to use the birthdate function to make an eventdate function, the problem is you can't choose a date after today because it's a birthday so .... i want the customer to choose a date of an event since today to 1 or 2 years after today ? If somebody can tell me where i have to apply modification or a hint to make that work ! Thank's a lot Link to comment Share on other sites More sharing options...
slykereven Posted February 22, 2017 Author Share Posted February 22, 2017 I find the 1st step, in classes/Tools.php replace public static function dateYears() { $tab = array(); for ($i = date('Y'); $i >= 1900; $i--) $tab[] = $i; return $tab; } by public static function dateYears() { $tab = array(); for ($i = date('Y'); $i >= date("Y"); $i--) $tab[] = $i; return $tab; } This delete all the years since 1900 and keep the actual year, now i'm looking to add 2 or 3 years after now like : 2017,2018,2019,2020 and validate in the customer account Link to comment Share on other sites More sharing options...
slykereven Posted February 22, 2017 Author Share Posted February 22, 2017 Finally i think it works with this, i'll make more test but for now it's ok. Customer can choose a year since now to 3 years after. public static function dateYears() { $tab = array(); for ($i = date('Y'); $i <= date("Y") + 3; $i++) $tab[] = $i; return $tab; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now