trentrichardson / jQuery-Timepicker-Addon

Adds a timepicker to jQueryUI Datepicker
http://trentrichardson.com/examples/timepicker/
MIT License
2.66k stars 1.05k forks source link

Showing milliseconds and microseconds #794

Closed yosug closed 9 years ago

yosug commented 9 years ago

In new version 1.5.2 it is showing milliseconds and microseconds and yesterday doesn't show it. I tried to set "showMillisec" and "showMicrosec" to false but nothing to do.

trentrichardson commented 9 years ago

Can you please provide the example code you are using? Newer versions of timepicker detect the units from the timeFormat. If you are using any tokens in your timeformat they must be declared as string literals via single quotes:

timeFormat: "HH:mm 'literal text'"

ThePoet444 commented 9 years ago

Sorry for Hijacking, I was just going to open a new ticket with the same problem. I have showMillisec: false and showMicrosec: false set and it still being displayed. I don't need them and would love to hide them. Using the latest? (1.5.2). Jquery 2*, Jqueryui 1.11.4

$( "#start" ).datetimepicker({
                dateFormat: "yy-mm-dd",
                timeFormat: "hh:mm:ss tt",
                showMillisec: false,
                showMicrosec: false,
                defaultDate: "+1w",
                changeMonth: true,
                numberOfMonths: 3,
                onClose: function( selectedDate ) {
                    $( "#end" ).datetimepicker( "option", "minDate", selectedDate );
                }
            });
trentrichardson commented 9 years ago

@yosug @ThePoet444 Sorry I forgot, just update your CSS. The hiding was updated to use css instead of jQuery.

ThePoet444 commented 9 years ago

I'm using the CSS that came with your plugin, do I have to manually specify something somewhere? (Warning Noob at work here)

nevermind I'm a derp. the CSS didn't get loaded.

trentrichardson commented 9 years ago

Ok, glad you got it working.

quedicesebas commented 9 years ago

I noticed I wasn't including the CSS! I think ypu should close this issue

DavidAnderson684 commented 9 years ago

Thank you - I also hit this problem when upgrading, and this helped me to the solution.

1) The example at http://trentrichardson.com/examples/timepicker/ should probably be updated - the CSS there doesn't include this.

2) I have probably overlooked something, but the CSS at https://github.com/trentrichardson/jQuery-Timepicker-Addon/blob/master/src/jquery-ui-timepicker-addon.css needed adjusting - the classes on my page didn't entirely match those used there. I had to swap .ui-timepicker-div.ui-timepicker-oneLine for .ui-timepicker-div everywhere to get it working.

DavidAnderson684 commented 9 years ago

OK - I get it now. The 'oneLine' stuff is an alternative layout. So, you shouldn't use both sets of rules; pick one, and remove the suffix if you're using the all-on-one-line style.

trentrichardson commented 9 years ago

You are correct. I just updated the css on the webpage to link to the full file as it is easy to forget to update it. I hope that helps with this issue. On Mar 31, 2015 5:40 AM, "David Anderson" notifications@github.com wrote:

OK - I get it now. The 'oneLine' stuff is an alternative layout. So, you shouldn't use both sets of rules; pick one, and remove the suffix if you're using the all-on-one-line style.

— Reply to this email directly or view it on GitHub https://github.com/trentrichardson/jQuery-Timepicker-Addon/issues/794#issuecomment-88016267 .