select a year before 1996 in the calendar?
select a year before 1996 in the calendar?
zhurb21
Posts: 12Questions: 5Answers: 0
How can I select a year less than 1996 when choosing a date in the calendar in search builder?
It seems like this should be an easy solution, but so far I have not been able to solve this problem.
For example, in this case i can't chose the year before 1996
https://www.datatables.net/extensions/searchbuilder/examples/initialisation/date-fmt.html
How i can fix that?
P.S. sorry, i'm just a newbie here
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The default list is kept small to ensure the picker doesn't get too big for
datetime
. You can modify it withopts.yearRange
- see example here : http://live.datatables.net/haniyiwu/2/editColin
Thank you for your answer.
Is it possible to solve it without using the Editor?
Ah, sorry, I missed that you'e using SearchBuilder. That uses the same control, so you just need to tweak the defaults to suit your needs - see example here: http://live.datatables.net/rapiqaxe/1/edit
Colin
Can you tell me exactly where I should do this in my case? I think it can be more complex because of the date format i used.
$(document).ready(function(){
var table = $('#myTable').DataTable({
'columnDefs': [
{type: 'date', targets: [7,9,10]}
],
"bFilter": true,
dom: 'Bfitl'
,buttons: [
{
extend: 'searchBuilder',
config: {
columns: [7,9,10],
depthLimit: 2,
}
}
],
}
});
I solved this problem by overwriting the yearRange field and by downloading this extension locally.
Thank you very much Colin for your help