mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Grouping: Add "monthyear" grouping to dates. Fixes #744
This commit is contained in:
parent
3c0380cad4
commit
ad85121da0
@ -398,6 +398,10 @@ group_dateString : function(date) {
|
||||
<td><code>"group-date-month"</code><span class="remark">*</span></td>
|
||||
<td>Group the rows by month.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>"group-date-monthyear"</code><span class="remark">*</span></td>
|
||||
<td>Group the rows by month & year.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>"group-date-week"</code><span class="remark">*</span></td>
|
||||
<td>Group the rows by day of the week.</td>
|
||||
@ -505,7 +509,7 @@ group_dateString : function(date) {
|
||||
numcol = 2,
|
||||
letcol = 4,
|
||||
datecol = 7,
|
||||
dateGroups = [ '', 'year', 'month', 'day', 'week', 'time' ];
|
||||
dateGroups = [ '', 'year', 'month', 'monthyear', 'day', 'week', 'time' ];
|
||||
// Numeric column slider
|
||||
$( "#slider0" ).slider({
|
||||
value: startBlock,
|
||||
@ -550,7 +554,7 @@ group_dateString : function(date) {
|
||||
$( "#slider2" ).slider({
|
||||
value: curGroup,
|
||||
min: 0,
|
||||
max: 5,
|
||||
max: dateGroups.length - 1,
|
||||
step: 1,
|
||||
create: function(){
|
||||
$('.dateclass').html(' "group-date' + (curGroup > 0 ? '-' + dateGroups[curGroup] : '') + '"');
|
||||
|
@ -43,6 +43,7 @@ ts.grouping = {
|
||||
hours = time.getHours();
|
||||
return part === 'year' ? time.getFullYear() :
|
||||
part === 'month' ? wo.group_months[time.getMonth()] :
|
||||
part === 'monthyear' ? wo.group_months[time.getMonth()] + ' ' + time.getFullYear() :
|
||||
part === 'day' ? wo.group_months[time.getMonth()] + ' ' + time.getDate() :
|
||||
part === 'week' ? wo.group_week[time.getDay()] :
|
||||
part === 'time' ? ('00' + (hours > 12 ? hours - 12 : hours === 0 ? hours + 12 : hours)).slice(-2) + ':' +
|
||||
|
Loading…
Reference in New Issue
Block a user