File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Mvc.JQuery.Datatables.Example/Controllers Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments