Topic: Today Button in Datepicker

AnotherStep free asked 3 years ago

Hello, in your datepicker the default buttons that appear are "Clear", "Close" and "Ok". I would like to know which settings to put in the initialization of the datepicker to also insert the "today" button.

Thanks so much.

Krzysztof Wilk staff answered 3 years ago


You can define it when you are initializing an instance of the date picker. Your code should look like this:

// Data Picker Initialization
     inline: true;

    // Buttons
    today: 'Today',
    clear: 'Clear',
    close: 'Close',

For more available options you can go here:

Best regards

soiware priority commented 1 year ago

I tryed with new mdb.Datepicker(myDateEle, { inline: false, today: "Today" });

But the "Today" button doesn't appear. Can you please publish a snipped? Thank you.

Mateusz Lazaru staff commented 1 year ago

This option was available in old version of the MDB4 datepicker, not supported anymore. Here is a link for anyone looking for its documentation:

soiware priority commented 1 year ago

Is there a way to have it again? Some users of mine complains abount having lost it.

Mateusz Lazaru staff commented 1 year ago

At the moment, we are not planning to add this button. In the old datepicker, the 'clear' button reset the selected day and closed the modal. Now, this button doesn't close the modal anymore, but it navigates back to 'today' and focuses on this day. I think adding a new button would have a negative impact on the design of the component, and it's not really worth that.

If you disagree with me and find this feature useful, I would encourage you to open a feature-request. This might let us know what other users think and also open discussion in our team.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.19.1
  • Device: Pc
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No