8

Does anyone know how to remove the "Now" button from the jquery timepicker add on file?

I removed the var currentText = 'Now', and this change removes the text, but the button is still there, labelled "Today" instead of "Now". I do not need this button in the timepicker.

I am using Trent Richardson's timepicker.

The timepicker can be seen on this website: click here

The js file can be seen here, click here

Ladlestein
  • 6,100
  • 2
  • 37
  • 49
BruceyBandit
  • 3,978
  • 19
  • 72
  • 144

5 Answers5

4

The 'Now' button replaces the Today button normally, but without text it uses the default.

In your CSS, simply set the now button to "display: none;"

If I remember correctly, you can set this in the .ui-priority-secondary - but not sure if it is used elsewhere.. have a play, but this should be your solution, just depends on usage.

Warren Sergent
  • 2,542
  • 4
  • 36
  • 42
2

Found my answer here:

I am using the Yii extension and added the code found at the site below to my css/main.css file. Voila!

https://forum.jquery.com/topic/disable-now-in-timepicker

Andrew
  • 37
  • 1
1

Use this CSS, Works fine for me.

.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
float:left;
background: #900;
display: none;
}
Dinesh
  • 371
  • 3
  • 8
1

To hide all the buttons of the calendar set the property showButtonPanel with false

$("#inputDate").datetimepicker({showButtonPanel: false});
rray
  • 2,518
  • 1
  • 28
  • 38
0

Following property to .timepicker() solved my problem:

minDate: new Date(2080, 1, 1)

Just provide very long date which disables now button by itself.

So the final code is:

$('#time-duration-box').timepicker({
    minDate: new Date(2050, 1, 1)
});
Kedar.Aitawdekar
  • 2,364
  • 1
  • 23
  • 25