3

Here is code

enter image description here

You can see the button and the prev ,next overlap

How to hide the prev ,next text ??

user2492364
  • 6,543
  • 22
  • 77
  • 147
  • possible duplicate of [Disable Next in Jquery datepicker](http://stackoverflow.com/questions/16040204/disable-next-in-jquery-datepicker) – Anant Dabhi Sep 29 '15 at 04:41

4 Answers4

4

DEMO

.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span {
    color: transparent;
}

You can use css to hide the next and previous button as shown in the demo

guradio
  • 15,524
  • 4
  • 36
  • 57
2
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span {
    font-size: 0;
}

You can hide the font by setting the css font-size to 0.

Demo

XYZ
  • 4,450
  • 2
  • 15
  • 31
rifa_at_so
  • 326
  • 1
  • 6
  • 18
1

Here is a function to Hide/Show the prev/next navigation.

$(function () {
    $('#datepicker').datepicker().focus(function () {
        $(".ui-datepicker-next").show();
        $(".ui-datepicker-prev").show();
    });
});

Here is codepen

Bùi Đức Khánh
  • 3,975
  • 6
  • 27
  • 43
Diggetydog
  • 56
  • 9
1

The most direct way is by setting the text to empty string. In your code, the date picker is initialized in Javascript/JQuery, and you can modify the initialization as follows:

$('.week-picker').datepicker({
   /* ... your existing intialization code ... */
   nextText: '',
   prevText: '',
   /* ... */
});

Alternatively, and in cases where you can't access the initialization in code, you can change the text after initialization:

$('.week-picker').datepicker('option', 'nextText', '');
$('.week-picker').datepicker('option', 'prevText', '');

I like this method better than setting the color to transparent, as suggested in one answer, as transparent strings are still selectable by the user. I also like it better than hiding the entire .ui-datepicker-next/prev elements as suggested by another answer, because that will hide the image as well, not only the text.

jogojapan
  • 68,383
  • 11
  • 101
  • 131