From:http://www.javascriptkit.com/script/script2/tengcalendar.shtml


----------------------------------------------------

1) Date (MM-dd-yyyy)

HTML code: <input ></a>

2) Date & Time(12-Hour) (dd-MMM-yyyy hh:mm:ss)

HTML code: <input ></a>

3) Date & Time(24-Hour) (dd-MM-yyyy HH:mm:ss)

HTML code: <input ></a>


-----------------------------------------------

Directions

1. Download the following zip file, which contains the necessary files plus a demo.

2. Upload "DateTimePicker.js" and "cal.gif" contained within the above zip file to your web site.

3. In the <head> section of your webpage that will display the Date Picker, insert the below code:

<script language="javascript" type="text/javascript" src="datetimepicker.js">

//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com

</script>

4. Create the desired textboxes that will use the Date Time Picker. A sample textbox looks like:

<input ></a>

As seen above, enter a unique ID into each <input> tag (in this case, "demo1"), and inside function "NewCal()", pass this ID as its first parameter. Below describes NewCal() in detail:

NewCal([textbox id],[date format],[show time in calendar?],[time mode (12,24)?])

a. You must enclose textbox id and date format with single quotes (').
b. Don't insert date separator in between of date format such as dd-MM-yyyy.
c. Parameters for "NewCal" function:

  • Textbox id (Mandatory)
  • Date format (optional) - If you don't specify date format, the default date format will be "dd-MM-yyyy". Other valid date formats for My Date Time Picker are: ddMMyyyy,MMddyyyy,ddMMMyyyy,MMMddyyyy.
  • Show time in calendar? (optional) [true or false] - Specify "true" if you would like to let user to pick a time. Default value is "false".
  • Time Mode (optional) [12 or 24] - Time shown in 12-hour or 24-hour format. Default is 24-hour format.

相关文章:

  • 2022-03-05
  • 2022-02-03
  • 2022-12-23
  • 2022-01-08
  • 2022-01-08
  • 2022-01-08
  • 2022-01-08
  • 2022-01-08
猜你喜欢
  • 2022-01-08
  • 2021-07-28
  • 2022-01-08
  • 2022-01-08
  • 2021-04-07
  • 2022-02-13
  • 2022-01-08
相关资源
相似解决方案