-1

Once I click the input box the time picker will display with the default current time. What I need is to remove the default current time.

Thanks,

2 Answers2

0

You basically have three options:

  • Initialize the field with your desired starting time in the correct format;
  • Use a button to create the picker when you want a time to appear, following the instructions at http://www.ama3.com/anytime/ for creating an "On-Demand Picker"
  • Use a keypress handler to create the picker when the user hits a key on the input field, following the "Tab-Over Field" demo on the same page

Because the picker constantly updates the field to reflect the time shown on the picker itself, there is no way to make it leave the field blank when the picker is displayed. You'd have to make changes to the code to only call this.inp.val(...) in situations where YOU want the field to be updated.

Andrew M. Andrews III
  • 1,989
  • 18
  • 23
0

This is an old post, but I ran into the same issue. From the documentation:

If a picker shows today's date/time instead of the value in the associated field, check that the format of the value matches the format specifier exactly. The value cannot be interpreted if it does not match perfectly!

This includes preceding zeroes. If you prime the field with the date "4/1/15" and anytime is expecting "04/01/15" it will not work correctly.

matthew_360
  • 5,901
  • 9
  • 32
  • 40