Menu Close
    Start a Project Request quote Reading list Switch to dark mode
    magento-hyperlocal-marketplace-guide

    Add Date Picker in Magento2 Configuration Section Using system.xml

    Here we learn how to add date picker in Magento2 configuration section using system.xml

    Step1# open your module system.xml from app/code/NameSpace/ModuleName/etc/adminhtml

    and following code in it


    step #2 : Now we create DatePicker class in file DatePicker.php  at app/code/NameSpace/ModuleName/Block/ folder where we create date picker element


    step 3# Now in your admin section you get this datepicker element as following

    thanks 🙂

    . . .

    Comments (4)

    Add Your Comment

  • Crest Design
    Great Article, Thank your for sharing this information.
    • Webkul Support
      Hi Crest Design, thanks for the kind words. 🙂
  • Michele Fantetti
    Great article!
    There is a mistake:
    you have to use $this->_coreRegistry->registrer(‘datepicker_loaded’, 1); insted of $this->_coreRegistry->registry(‘datepicker_loaded’, 1);
    and in any case I don’t understand why you need this check; why do you need to register ‘datepicker_loaded’ variable?
    Could you explain this choise?
  • yogesh
    What if i want to have a date-picker in my front-end custom form for DOB field.
  • Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close