Thread

Calling the date-picker on a custom field

August 01, 2017 4:14pm

Subscribe [3]
  • #1 / Aug 01, 2017 4:14pm

    Reinos

    53 posts

    In EE3 we got a nice looking date-picker. Is there any change we can re-use it? By inspecting the element i see a attr rel=”date-picker”. But placing this on a field, does not work.

    Question; how can we use the date-picker?

  • #2 / Aug 01, 2017 6:46pm

    Kevin Cupp's avatar

    Kevin Cupp

    681 posts

    There isn’t a great reusable solution to this, it will involve some copying and pasting. Take a look at mcp.simple_commerce.php towards the bottom of the purchaseForm() method. You have to set all those global JavaScript variables and ultimately include the cp/date_picker file. And if you look at the purchase_date field configuration, you’ll see you can set a data-timestamp= attribute to assign an initial date to the field.

ExpressionEngine News

#eecms, #events, #releases