How can I show today's date on date picker?

Hi,

I want to show today’s date on date picker. what’s wrong with the following code?

<input id="EventDate" name="EventDate" type="date" is="dmx-date-picker" dmx-text="var1.datetime.format('dd/mm/yyyy')">

In App Structure add ‘Date and Time’
then just bind it to whatever you want (use the format date to change it to how you want it to show).
This will give you the date & time if required.

Hi,

I added like this though, it doesn't show the date...how should I amend this?

dmx-text=“var1.datetime.formatDate(“dd-MM-yyyy”)”

it didn’t work neither double quotation nor single quotation with dd-MM-yyyy part…

do you have a link to your page, as this works perfectly on mine with no issues.

please have a look at http://174.138.46.199/

I don’t see dmx-datetime id=“var1” anywhere on your page.

Have a look at the source here https://testing.thegunnery.online/index.html

this is SPA.

Currently
index.php-----without dmx-datetime
|–home.php—with dmx-datetime

and I would like to show this “date” on date picker.

index.php should include dmx-datetime? I tried that though, still doesn’t work…

So you are trying to get a date select to show todays date?

yes! that’s what I want to do!

It should be on todays date automatically.
I have just double checked this and it happening on mine.
https://testing.thegunnery.online/index.html

I assume your text input is set to text and NOT date

I would like to select “today” on datepicker like this image.
As long as I saw your example, “today” was shown separately from datepicker…that was not what I am thinking.

Ok so in Dynamic Attributes add a value and set that the Date and Time (Var1) and again format it to what you want.

Look at the sample page I have put it there for you,

I’m trying to mimic your sample though, data picker doesn’t show up when I set “type=text”. how can you make it work?

Make sure you have uploaded ALL the files just in case it's missing something.
Check your JQuery min is set to Slim 3.3.1 cnd

It should work with no issues

input id="text1" name="text1" type="text" class="form-control" is="dmx-date-picker" dmx-bind:value="var1.datetime.formatDate("dd-MM-yyyy")"

1 Like

when I uploaded files in the head tag, now it worked!! thank you so much for taking your time!!

1 Like

Good glad its working and I could help

1 Like