Custom field for future date

  • Posts: 209
  • Thank you received: 18
10 years 9 months ago #139010

-- HikaShop version -- : 2.2.2 Business
-- Joomla version -- : 2.5.16

I'm trying to setup a custom field for the user to select a future date that is greater than today's date (ie: from tomorrow onwards) for a required delivery date of the item. I have it in the item table and required so that the user can't add to cart if it is not selected.

I have two problems:

1. When I set the "Allow" field to "Only future dates" it still allows the user to select todays date. Possibly it is based on time rather than date? Is there a way to set this to be today's date +1 day?

2. When I set the format to show as "Friday, 10-Jan-2014" using %D, %d-%M-%Y with Only future dates selected the front end gives an error "Please select a date in the future". Is there a way to set the format to display the long date when using the Only future dates value?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
10 years 9 months ago #139113

Hi,

The algorithm always accept today for future dates and past dates.
There is no special option to change it except using the "Dynamic Calendar".
www.hikashop.com/index.php?option=com_hi...uct&task=show&cid=19

About the second point. The system can't convert a date with a day in string format into a understandable date.
So for the checks made in javascript, it can't understand the "Friday" word.
The plugin dynamic calendar can help you too to solve this problem because it store the value using a fixed format value and display the date with your specific format.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 209
  • Thank you received: 18
10 years 9 months ago #139143

Hi Jerone,

I purchased and installed the plugin. Whilst it looks nice on the front end, it has a few problems:

1. When I select "Only future dates" it still allows the current date to be selected.

2. When I specify a date format it instantly puts "Thu, 01-Jan-1970" in as the default value.

3. The language file appears to be missing so I'm not sure what each variable is supposed to do:


I tried to fix by loading the latest Hikashop language file but nothing changed.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 209
  • Thank you received: 18
10 years 9 months ago #139144

Hi again Jerome!

update - more issues...

1. As soon as I EDIT the custom field in the backend it populates the default date as 1 Jan 1970 even when there is no format specified.

2. I tried to set the default date to today (using the radio button) and it puts today's date (with the time) in as default in the frontend despite having "only future dates" selected. It also puts todays date into the default date parameter in the backend. Does this mean the default date is permanently hardcoded as this date?

3. The only way to clear the default date is to delete the custom field and create a new one and make all required changes on the first save.

Any suggestions?

Please Log in or Create an account to join the conversation.

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
10 years 9 months ago #139166

Hi,

First, I will see how the language file of the plugin is not loaded.

About the future date and today. You have to enter a value for the option "waiting days".
It is an option to add days (or remove days) for the selection (in past or future).

To remove the default date, you have to remove the "required", clear the default and re-put the require.
This "required" option is generating the side effect. We will see how we can remove it only in the configuration panel.

If you use the option "default today", the date picker will choose today as default value (and will override the date you will configure as default value). When the "waiting days" are configure, the date picker will process the new default value it has to display.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 209
  • Thank you received: 18
10 years 9 months ago #139389

Thanks - that works perfectly!

Please Log in or Create an account to join the conversation.

Time to create page: 0.080 seconds
Powered by Kunena Forum