File tree 5 files changed +62
-15
lines changed
scheduler/scheduler-server-filtering/KendoUI_Scheduler_Server_Filtering
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
9
9
{
10
10
public class HomeController : Controller
11
11
{
12
-
13
12
private SchedulerTaskService taskService ;
14
13
15
14
public HomeController ( )
@@ -22,9 +21,9 @@ public ActionResult Index()
22
21
return View ( ) ;
23
22
}
24
23
25
- public virtual JsonResult Read ( DataSourceRequest request , DateTime start , DateTime end )
24
+ public virtual JsonResult Read ( DataSourceRequest request , FilterRange range )
26
25
{
27
- var data = taskService . GetRange ( start , end ) ;
26
+ var data = taskService . GetRange ( range . Start , range . End ) ;
28
27
return Json ( data . ToDataSourceResult ( request ) ) ;
29
28
}
30
29
Original file line number Diff line number Diff line change 15
15
<AssemblyName >KendoUI_Scheduler_Server_Filtering</AssemblyName >
16
16
<TargetFrameworkVersion >v4.5</TargetFrameworkVersion >
17
17
<MvcBuildViews >false</MvcBuildViews >
18
- <UseIISExpress >true </UseIISExpress >
18
+ <UseIISExpress >false </UseIISExpress >
19
19
<IISExpressSSLPort />
20
20
<IISExpressAnonymousAuthentication />
21
21
<IISExpressWindowsAuthentication />
133
133
<Compile Include =" App_Start\FilterConfig.cs" />
134
134
<Compile Include =" App_Start\RouteConfig.cs" />
135
135
<Compile Include =" App_Start\WebApiConfig.cs" />
136
+ <Compile Include =" Controllers\FilterRange.cs" />
136
137
<Compile Include =" Controllers\HomeController.cs" />
137
138
<Compile Include =" Global.asax.cs" >
138
139
<DependentUpon >Global.asax</DependentUpon >
263
264
<VisualStudio >
264
265
<FlavorProperties GUID =" {349c5851-65df-11da-9384-00065b846f21}" >
265
266
<WebProjectProperties >
266
- <UseIIS >True </UseIIS >
267
+ <UseIIS >False </UseIIS >
267
268
<AutoAssignPort >True</AutoAssignPort >
268
- <DevelopmentServerPort >0 </DevelopmentServerPort >
269
+ <DevelopmentServerPort >46979 </DevelopmentServerPort >
269
270
<DevelopmentServerVPath >/</DevelopmentServerVPath >
270
- <IISUrl >http://localhost:43849/ </IISUrl >
271
+ <IISUrl >http://localhost/KendoUI_Scheduler_Server_Filtering </IISUrl >
271
272
<NTLMAuthentication >False</NTLMAuthentication >
272
273
<UseCustomServer >False</UseCustomServer >
273
274
<CustomServerUrl >
Original file line number Diff line number Diff line change 32
32
function getAdditionalData () {
33
33
var scheduler = $ (" #scheduler" ).data (" kendoScheduler" );
34
34
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
+
35
44
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 )
38
47
}
39
48
40
49
return result;
Original file line number Diff line number Diff line change 8
8
@Scripts.Render( "~/bundles/modernizr")
9
9
10
10
<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 >
17
17
<script src =" @Url.Content(" ~ /Scripts /kendo.modernizr.custom.js " )" ></script >
18
18
</head >
19
19
<body >
You can’t perform that action at this time.
0 commit comments