Page 2 of 2

How do you set the default date within the date picker to today's date?

Posted: Thu Sep 18, 2014 2:47 pm
by Mike6979865

So, the problem is even though I see today's date in the input on page show based on the code that you provided, when I click on View Ticket By Date, it's not searching for tickets for that date. In order for it to work, I have to click on the calender button, select a day, and then click view tickets by date. So, I'm trying to avoid that.

Regards,


How do you set the default date within the date picker to today's date?

Posted: Thu Sep 18, 2014 10:22 pm
by Yurii Orishchuk

Hi Mike,

Thanks for detail explanation.

Yes you are right code above only change view. And does not change value to store in service.

Here is correct code for you:

pre

//Create date. You can set here the date you need.
var currDate = new Date();
//Note: you should replace "mobiledatepicker_132" with your datepicker component.
$('div[dsid="mobiledatepicker_132"] input').val((currDate.getMonth()+1)+'/'+currDate.getDate()+'/'+currDate.getFullYear()).trigger("change");
console.log("Set date for datepicker component as = '" + (currDate.getMonth()+1)+'/'+currDate.getDate()+'/'+currDate.getFullYear() + "'");

/pre

Regards.


How do you set the default date within the date picker to today's date?

Posted: Wed Oct 22, 2014 2:19 am
by She

hi sir yuri,

how to remove the seperator into the date? for example if the date picker is format like this 10-22-2014, i want to change the format like this 10222014 into the label everytime i change the date.


How do you set the default date within the date picker to today's date?

Posted: Thu Oct 23, 2014 1:52 am
by Yurii Orishchuk

Hi She,

Please follow these steps:

1 Activate datePicker.

2 Add "value change" event with action "Run JavaScript".

3 Populate it with following code:

pre

//Replace "startDate" with your datePicker component name.
var dateText = Apperyio("startDate").attr("defaultDate");

dateText = dateText.replace(/\/|-/gi, "");

//Replace "dateLabel" with your label component name.
Apperyio("dateLabel").text("dateText = " + dateText);

/pre

Details: http://prntscr.com/4ytb18/direct

Regards.


How do you set the default date within the date picker to today's date?

Posted: Wed Nov 12, 2014 3:06 pm
by danielle lee

I cannot get the date picker to change the default to the current date. I have tried everything Please help!


How do you set the default date within the date picker to today's date?

Posted: Wed Nov 12, 2014 7:38 pm
by Evgene Karachevtsev

Danielle,

Please look here:
https://getsatisfaction.com/apperyio/...