Skip to content

Commit 65e2cb8

Browse files
committed
Set filter to 2014 so there is some data!
1 parent c54d55f commit 65e2cb8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Mvc.JQuery.Datatables.Example/Controllers/HomeController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public class UserView
8282
public string Position { get; set; }
8383

8484
[DataTablesFilter(DataTablesFilterType.DateTimeRange)]
85-
[DefaultToStartOfYear]
85+
[DefaultToStartOf2014]
8686
public DateTime? Hired { get; set; }
8787

8888
public Numbers Number { get; set; }
@@ -93,12 +93,12 @@ public class UserView
9393

9494
}
9595

96-
public class DefaultToStartOfYearAttribute : DataTablesAttributeBase
96+
public class DefaultToStartOf2014Attribute : DataTablesAttributeBase
9797
{
9898
public override void ApplyTo(ColDef colDef, PropertyInfo pi)
9999
{
100100
colDef.SearchCols = colDef.SearchCols ?? new JObject();
101-
colDef.SearchCols["sSearch"] = new DateTime(DateTime.Now.Year, 1, 1).ToString("g") + "~" + DateTimeOffset.Now.Date.AddDays(1).ToString("g");
101+
colDef.SearchCols["sSearch"] = new DateTime(2014, 1, 1).ToString("g") + "~" + DateTimeOffset.Now.Date.AddDays(1).ToString("g");
102102
}
103103
}
104104
}

0 commit comments

Comments
 (0)