Date picker in Magento product custom option gives only date. Need date and time

Date picker in Magento product custom option gives only date. Need date and time

October 1, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Date picker in Magento product custom option gives only date. Need date and time

Solving Date and Time Picker Issues in Magento Custom Options

Are you facing challenges when trying to display both date and time using a date picker in your Magento product custom options? You’re not alone! This common issue can lead to confusion for customers and may impact the user experience of your e-commerce store.

In this guide, I’ll walk you through the process of correctly setting up a date and time picker for your Magento products without any dropdown boxes.

Understanding the Current Setup

First, let’s review your current configuration:

  1. You have added a custom option to your product with an input type set as “Date & Time.”
  2. To avoid the default dropdown, you’ve enabled JavaScript Calendar in the system configuration under System > Configuration > Catalog > Catalog > Date&Time Custom Options.

However, even after enabling JavaScript Calendar, the date picker still only displays dates and not times. The time selection remains as a separate dropdown box.

Solving the Problem: A Step-by-Step Guide

To resolve this issue and display both date and time in a single date picker field without any dropdowns, follow these steps:

  1. Enable the jQuery UI Datepicker

    • Navigate to System > Configuration > Advanced.
    • In the “Developer” section, set “JavaScript Enabled” to “Yes.”
    • Also, enable “jQuery UI Enabled.”
  2. Add Custom JavaScript and CSS

    • Go to the Magento admin panel and navigate to “CMS > Pages.”
    • Create a new page named “DateTimePicker” with the following content:
      <!DOCTYPE html>
      <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>Date Time Picker Example</title>
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
        <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
      </head>
      <body>
        <input type="text" id="datetimepicker" />
        <script>
          $(function() {
            $("#datetimepicker").datepicker({
              showOn: "button",
              buttonImage: "http://jqueryui.com/demos/datepick/images/calendar.gif",
              buttonImageOnly: true
            });
          });
        </script>
      </body>
      </html>
      
    • Save the page.
  3. Modifying the Custom Option

    • Go to Catalog > Manage Products.
    • Click on your product.
    • Under “Custom Options”, add a new option with an input type set as “Text Box.”
    • Set the field name to match the date time format you require (e.g., “MM/DD/YYYY HH:MM AM/PM”).
    • Save the custom option.

The Final Touches

To ensure the date and time picker is used instead of the built-in one:

  1. Go to System > Configuration > Catalog > Catalog > Date&Time Custom Options.
  2. Set “Use JavaScript Calendar” to “No.”

Now, when a customer views your product’s custom options, they should see a single field for both date and time selections without any dropdown boxes.

Remember, it’s essential to thoroughly test this setup on different browsers and devices to ensure compatibility with your store’s specific requirements.

Conclusion

In this post, we’ve explored how to solve the common Magento issue of displaying both date and time in a single field using a date picker. By following our step-by-step guide, you can enhance the user experience for your customers while maintaining the professionalism of your e-commerce platform.

If you found this solution helpful, feel free to share it with your colleagues or leave a comment below! At Laravel Company, we’re always eager to hear about your experiences and challenges in Magento development.

Catalog Database Themes Admin

Our network