datepicker add year increase / decrease, #44.
This commit is contained in:
parent
f17219d054
commit
d25b53ab33
3 changed files with 23 additions and 3 deletions
|
@ -51,9 +51,11 @@ var datepick = function(container) {
|
|||
var thead = $(
|
||||
'<thead>' +
|
||||
'<tr>' +
|
||||
'<th><button type="button" class="button blue prev_y" title="Previous Year"><<</button></th>' +
|
||||
'<th><button type="button" class="button blue prev" title="Previous Month"><</button></th>' +
|
||||
'<th class="month-pick" colspan="5" title="Select Month">'+this.months[this.m]+' '+this.y+'</th>' +
|
||||
'<th class="month-pick" colspan="3" title="Select Month">'+this.months[this.m]+' '+this.y+'</th>' +
|
||||
'<th><button type="button" class="button blue next" title="Next Month">></button></th>' +
|
||||
'<th><button type="button" class="button blue next_y" title="Next Year">>></button></th>' +
|
||||
'</tr>' +
|
||||
'<tr>' +
|
||||
'<th>Mo</th>' +
|
||||
|
@ -68,12 +70,22 @@ var datepick = function(container) {
|
|||
);
|
||||
|
||||
var x = this;
|
||||
$(thead).find(".prev_y").click(function(){
|
||||
x.dec_y();
|
||||
x.load_table();
|
||||
$(thead).find(".month-pick").text(x.months[x.m]+' '+x.y);
|
||||
});
|
||||
$(thead).find(".prev").click(function(){
|
||||
x.dec_m();
|
||||
x.load_table();
|
||||
$(thead).find(".month-pick").text(x.months[x.m]+' '+x.y);
|
||||
});
|
||||
|
||||
$(thead).find(".next_y").click(function(){
|
||||
x.inc_y();
|
||||
x.load_table();
|
||||
$(thead).find(".month-pick").text(x.months[x.m]+' '+x.y);
|
||||
});
|
||||
$(thead).find(".next").click(function(){
|
||||
x.inc_m();
|
||||
x.load_table();
|
||||
|
|
|
@ -1055,7 +1055,8 @@ code {
|
|||
text-align: center;
|
||||
}
|
||||
.datepicker table {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.datepicker th,
|
||||
|
@ -1063,6 +1064,9 @@ code {
|
|||
width: 12.5%;
|
||||
}
|
||||
|
||||
.datepicker th {
|
||||
padding: 5px 0;
|
||||
}
|
||||
.datepicker td {
|
||||
color: #999;
|
||||
padding: 5px;
|
||||
|
|
|
@ -1173,7 +1173,8 @@ code {
|
|||
text-align: center;
|
||||
}
|
||||
.datepicker table {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.datepicker th,
|
||||
|
@ -1181,6 +1182,9 @@ code {
|
|||
width: 12.5%;
|
||||
}
|
||||
|
||||
.datepicker th {
|
||||
padding: 5px 0;
|
||||
}
|
||||
.datepicker td {
|
||||
color: var(--datepicker-inactive-month);
|
||||
padding: 5px;
|
||||
|
|
Loading…
Reference in a new issue