File tree Expand file tree Collapse file tree 5 files changed +62
-15
lines changed
scheduler/scheduler-server-filtering/KendoUI_Scheduler_Server_Filtering Expand file tree Collapse file tree 5 files changed +62
-15
lines changed Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
4+ using System . Web ;
5+
6+ namespace KendoUI_Scheduler_Server_Filtering . Controllers
7+ {
8+ public class FilterRange
9+ {
10+ private DateTime start ;
11+ public DateTime Start
12+ {
13+ get
14+ {
15+ return start ;
16+ }
17+ set
18+ {
19+ start = value . ToUniversalTime ( ) ;
20+ }
21+ }
22+
23+ private DateTime end ;
24+ public DateTime End
25+ {
26+ get
27+ {
28+ return end ;
29+ }
30+ set
31+ {
32+ end = value . ToUniversalTime ( ) ;
33+ }
34+ }
35+
36+
37+ }
38+ }
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ namespace KendoUI_Scheduler_Server_Filtering.Controllers
99{
1010 public class HomeController : Controller
1111 {
12-
1312 private SchedulerTaskService taskService ;
1413
1514 public HomeController ( )
@@ -22,9 +21,9 @@ public ActionResult Index()
2221 return View ( ) ;
2322 }
2423
25- public virtual JsonResult Read ( DataSourceRequest request , DateTime start , DateTime end )
24+ public virtual JsonResult Read ( DataSourceRequest request , FilterRange range )
2625 {
27- var data = taskService . GetRange ( start , end ) ;
26+ var data = taskService . GetRange ( range . Start , range . End ) ;
2827 return Json ( data . ToDataSourceResult ( request ) ) ;
2928 }
3029
Original file line number Diff line number Diff line change 1515 <AssemblyName >KendoUI_Scheduler_Server_Filtering</AssemblyName >
1616 <TargetFrameworkVersion >v4.5</TargetFrameworkVersion >
1717 <MvcBuildViews >false</MvcBuildViews >
18- <UseIISExpress >true </UseIISExpress >
18+ <UseIISExpress >false </UseIISExpress >
1919 <IISExpressSSLPort />
2020 <IISExpressAnonymousAuthentication />
2121 <IISExpressWindowsAuthentication />
133133 <Compile Include =" App_Start\FilterConfig.cs" />
134134 <Compile Include =" App_Start\RouteConfig.cs" />
135135 <Compile Include =" App_Start\WebApiConfig.cs" />
136+ <Compile Include =" Controllers\FilterRange.cs" />
136137 <Compile Include =" Controllers\HomeController.cs" />
137138 <Compile Include =" Global.asax.cs" >
138139 <DependentUpon >Global.asax</DependentUpon >
263264 <VisualStudio >
264265 <FlavorProperties GUID =" {349c5851-65df-11da-9384-00065b846f21}" >
265266 <WebProjectProperties >
266- <UseIIS >True </UseIIS >
267+ <UseIIS >False </UseIIS >
267268 <AutoAssignPort >True</AutoAssignPort >
268- <DevelopmentServerPort >0 </DevelopmentServerPort >
269+ <DevelopmentServerPort >46979 </DevelopmentServerPort >
269270 <DevelopmentServerVPath >/</DevelopmentServerVPath >
270- <IISUrl >http://localhost:43849/ </IISUrl >
271+ <IISUrl >http://localhost/KendoUI_Scheduler_Server_Filtering </IISUrl >
271272 <NTLMAuthentication >False</NTLMAuthentication >
272273 <UseCustomServer >False</UseCustomServer >
273274 <CustomServerUrl >
Original file line number Diff line number Diff line change 3232 function getAdditionalData () {
3333 var scheduler = $ (" #scheduler" ).data (" kendoScheduler" );
3434
35+ var timezone = scheduler .options .timezone ;
36+ var startDate = kendo .timezone .convert (scheduler .view ().startDate (), timezone, " Etc/UTC" );
37+ var endDate = kendo .timezone .convert (scheduler .view ().endDate (), timezone, " Etc/UTC" );
38+
39+ // optionally add startTime / endTime of the view
40+ var startTime = kendo .date .getMilliseconds (scheduler .view ().startTime ());
41+ var endTime = kendo .date .getMilliseconds (scheduler .view ().endTime ());
42+ endTime = endTime == 0 ? kendo .date .MS_PER_DAY : endTime;
43+
3544 var result = {
36- start : scheduler . view (). startDate (). toISOString ( ),
37- end : scheduler . view (). endDate (). toISOString ( )
45+ Start : new Date ( startDate . getTime () - ( startDate . getTimezoneOffset () * kendo . date . MS_PER_MINUTE ) + startTime ),
46+ End : new Date ( endDate . getTime () - ( endDate . getTimezoneOffset () * kendo . date . MS_PER_MINUTE ) + endTime )
3847 }
3948
4049 return result;
Original file line number Diff line number Diff line change 88 @Scripts.Render( "~/bundles/modernizr")
99
1010 <script src =" http://code.jquery.com/jquery-1.9.1.min.js" ></script >
11- <link href =" http://cdn.kendostatic.com/2013 .3.1119 /styles/kendo.common.min.css" rel =" stylesheet" type =" text/css" />
12- <link href =" http://cdn.kendostatic.com/2013 .3.1119 /styles/kendo.default.min.css" rel =" stylesheet" type =" text/css" />
13- <script src =" http://cdn.kendostatic.com/2013 .3.1119 /js/jquery.min.js" ></script >
14- <script src =" http://cdn.kendostatic.com/2013 .3.1119 /js/kendo.all.min.js" ></script >
15- <script src =" http://cdn.kendostatic.com/2013 .3.1119 /js/kendo.timezones.min.js" ></script >
16- <script src =" http://cdn.kendostatic.com/2013 .3.1119 /js/kendo.aspnetmvc.min.js" ></script >
11+ <link href =" http://cdn.kendostatic.com/2015 .3.930 /styles/kendo.common.min.css" rel =" stylesheet" type =" text/css" />
12+ <link href =" http://cdn.kendostatic.com/2015 .3.930 /styles/kendo.default.min.css" rel =" stylesheet" type =" text/css" />
13+ <script src =" http://cdn.kendostatic.com/2015 .3.930 /js/jquery.min.js" ></script >
14+ <script src =" http://cdn.kendostatic.com/2015 .3.930 /js/kendo.all.min.js" ></script >
15+ <script src =" http://cdn.kendostatic.com/2015 .3.930 /js/kendo.timezones.min.js" ></script >
16+ <script src =" http://cdn.kendostatic.com/2015 .3.930 /js/kendo.aspnetmvc.min.js" ></script >
1717 <script src =" @Url.Content(" ~ /Scripts /kendo.modernizr.custom.js " )" ></script >
1818</head >
1919<body >
You can’t perform that action at this time.
0 commit comments