2

Currently, I have text box that asks for a date. However, I would like to get date format like 9/13/2013 to 10/30/2013 from parameter. How can I add to date and from date to text box?

Pedram
  • 6,256
  • 10
  • 65
  • 87
HAIZD
  • 179
  • 1
  • 1
  • 16

2 Answers2

1

I believe you want a single text box to display the From and to dates. You can do this by referencing the parameters directly from your text box.

  1. With the cursor flashing indicating you can type in the text box, right click it and select Create Placeholder

  2. In the popup that appears click the fx button

  3. Set the value to be the FromDate parameter

enter image description here

  1. Set the format of the expression by clicking the Number tab of the popup, and selecting the date format you want, as shown

enter image description here

  1. Then back in the text box carrying on writing in normal text "to"

  2. Repeat steps 1 to 4 for the ToDate

  3. The result should look something like this in design mode...

enter image description here

  1. ...and like this in preview mode

enter image description here

Hopefully this is the output you were imagining. If not, please let me know and I shall try to help further.

Jonnus
  • 2,988
  • 2
  • 24
  • 33
0

As far as I understand your question, you want something like this:

<span>To:</span><input type="date" id="toDate"/><span>From:</span><input type="date" id="fromDate"/>

In this case, the resulting page will have a textbox for a "to" date and a "from" date, both with a mm/dd/yyyy template built in. From here, you could then get the text box using document.getElementById, or jQuery, then get the value, and use subtract the dates. For date wrangling, I highly recommend moment.js, by the way.

Alexis Dumas
  • 1,299
  • 11
  • 30