Skip to content

Commit 001c0df

Browse files
Merge pull request #4553 from syncfusion-content/EJ2-966391-hotfix-asp
966391: Updated Asp.net UG Documentation
2 parents 59c380f + c1106e0 commit 001c0df

File tree

12 files changed

+112
-44
lines changed

12 files changed

+112
-44
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@{
2+
var serverTimezoneOffset = 5.5;
3+
var initialDate = new Date();
4+
}
5+
6+
@Html.EJS().DatePicker("datepicker")
7+
.ServerTimezoneOffset(serverTimezoneOffset)
8+
.Value(initialDate)
9+
.Render()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
@{
3+
var serverTimezoneOffset = 5.5;
4+
var initialDate = new Date();
5+
}
6+
7+
<ejs-datetimepicker id="datetimepicker" value="intialDate" serverOffset="serverTimezoneOffset"></ejs-datetimepicker>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
7+
namespace EJ2CoreSampleBrowser.Controllers
8+
{
9+
public class HomeController : Controller
10+
{
11+
public ActionResult Datepicker()
12+
{
13+
ViewBag.serverTimezoneOffset=5.5;
14+
ViewBag.initalDate=new Date();
15+
return View();
16+
}
17+
}
18+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@{
2+
var serverTimezoneOffset = 5.5;
3+
var initialDate = new Date();
4+
}
5+
6+
@Html.EJS().DateTimePicker("datetimepicker")
7+
.ServerTimezoneOffset(serverTimezoneOffset)
8+
.Value(initialDate)
9+
.Render()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
@{
3+
var serverTimezoneOffset = 5.5;
4+
var initialDate = new Date();
5+
}
6+
7+
<ejs-datetimepicker id="datetimepicker" value="intialDate" serverOffset="serverTimezoneOffset"></ejs-datetimepicker>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
7+
namespace EJ2CoreSampleBrowser.Controllers
8+
{
9+
public class HomeController : Controller
10+
{
11+
public ActionResult DateTimepicker()
12+
{
13+
ViewBag.serverTimezoneOffset=5.5;
14+
ViewBag.initalDate=new Date();
15+
return View();
16+
}
17+
}
18+
}

ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The DatePicker component displays and maintains the selected date value based on
1414

1515
N> if the system time zone is changed dynamically after a value is selected, the DatePicker will **not update or shift** the selected value. The component preserves the original selection, ensuring a stable and reliable user experience.
1616

17-
## `serverTimezoneOffset`
17+
## serverTimezoneOffset
1818

1919
The `serverTimezoneOffset` property allows you to specify the server's time zone offset from UTC in **hours** or **fractional hours**. This is useful when binding values from the server to ensure they are interpreted correctly on the client side.
2020

@@ -26,16 +26,15 @@ The `serverTimezoneOffset` property allows you to specify the server's time zone
2626

2727
N> The `serverTimezoneOffset` property is applicable **only for pre-bound values** (i.e., values set during initialization or data binding). It does **not affect** values selected by the user during runtime.
2828

29-
### Example
29+
{% if page.publishingplatform == "aspnet-core" %}
3030

31-
```ts
32-
import { DatePicker } from '@syncfusion/ej2-calendars';
31+
{% tabs %}
32+
{% include code-snippet/datepicker/timezone-cs1/tagHelper %}
33+
{% endtabs %}
3334

34-
/* Initialize the DatePicker component */
35-
let datepicker: DatePicker = new DatePicker({
36-
placeholder: "Select Date",
37-
width: "250px",
38-
serverTimezoneOffset: 5.5 // Example: UTC+5:30 for IST
39-
});
35+
{% elsif page.publishingplatform == "aspnet-mvc" %}
4036

41-
datepicker.appendTo('#datepicker');
37+
{% tabs %}
38+
{% include code-snippet/datepicker/timezone-cs1/razor %}
39+
{% endtabs %}
40+
{% endif %}

ej2-asp-core-mvc/datepicker/EJ2_ASP.NETCORE/timezone-behavior.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The DatePicker component displays and maintains the selected date value based on
1414

1515
N> if the system time zone is changed dynamically after a value is selected, the DatePicker will **not update or shift** the selected value. The component preserves the original selection, ensuring a stable and reliable user experience.
1616

17-
## `serverTimezoneOffset`
17+
## serverTimezoneOffset
1818

1919
The `serverTimezoneOffset` property allows you to specify the server's time zone offset from UTC in **hours** or **fractional hours**. This is useful when binding values from the server to ensure they are interpreted correctly on the client side.
2020

@@ -26,16 +26,15 @@ The `serverTimezoneOffset` property allows you to specify the server's time zone
2626

2727
N> The `serverTimezoneOffset` property is applicable **only for pre-bound values** (i.e., values set during initialization or data binding). It does **not affect** values selected by the user during runtime.
2828

29-
### Example
29+
{% if page.publishingplatform == "aspnet-core" %}
3030

31-
```ts
32-
import { DatePicker } from '@syncfusion/ej2-calendars';
31+
{% tabs %}
32+
{% include code-snippet/datepicker/timezone-cs1/tagHelper %}
33+
{% endtabs %}
3334

34-
/* Initialize the DatePicker component */
35-
let datepicker: DatePicker = new DatePicker({
36-
placeholder: "Select Date",
37-
width: "250px",
38-
serverTimezoneOffset: 5.5 // Example: UTC+5:30 for IST
39-
});
35+
{% elsif page.publishingplatform == "aspnet-mvc" %}
4036

41-
datepicker.appendTo('#datepicker');
37+
{% tabs %}
38+
{% include code-snippet/datepicker/timezone-cs1/razor %}
39+
{% endtabs %}
40+
{% endif %}

ej2-asp-core-mvc/datetimepicker/EJ2_ASP.MVC/timezone-behavior.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The DateTimePicker component displays and maintains the selected date and time v
1414

1515
N> if the system time zone is changed dynamically after a value is selected, the DateTimePicker will **not update or shift** the selected value. The component preserves the original selection, ensuring a stable and reliable user experience.
1616

17-
## `serverTimezoneOffset`
17+
## serverTimezoneOffset
1818

1919
The `serverTimezoneOffset` property allows you to specify the server's time zone offset from UTC in **hours** or **fractional hours**. This is useful when binding values from the server to ensure they are interpreted correctly on the client side.
2020

@@ -26,16 +26,15 @@ The `serverTimezoneOffset` property allows you to specify the server's time zone
2626

2727
N> The `serverTimezoneOffset` property is applicable **only for pre-bound values** (i.e., values set during initialization or data binding). It does **not affect** values selected by the user during runtime.
2828

29-
### Example
29+
{% if page.publishingplatform == "aspnet-core" %}
3030

31-
```ts
32-
import { DateTimePicker } from '@syncfusion/ej2-calendars';
31+
{% tabs %}
32+
{% include code-snippet/datetimepicker/timezone-cs1/tagHelper %}
33+
{% endtabs %}
3334

34-
/* Initialize the DateTimePicker component */
35-
let datetimepicker: DateTimePicker = new DateTimePicker({
36-
placeholder: "Select Date Time",
37-
width: "250px",
38-
serverTimezoneOffset: 5.5 // Example: UTC+5:30 for IST
39-
});
35+
{% elsif page.publishingplatform == "aspnet-mvc" %}
4036

41-
datetimepicker.appendTo('#datetimepicker');
37+
{% tabs %}
38+
{% include code-snippet/datetimepicker/timezone-cs1/razor %}
39+
{% endtabs %}
40+
{% endif %}

ej2-asp-core-mvc/datetimepicker/EJ2_ASP.NETCORE/timezone-behavior.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The DateTimePicker component displays and maintains the selected date and time v
1414

1515
N> if the system time zone is changed dynamically after a value is selected, the DateTimePicker will **not update or shift** the selected value. The component preserves the original selection, ensuring a stable and reliable user experience.
1616

17-
## `serverTimezoneOffset`
17+
## serverTimezoneOffset
1818

1919
The `serverTimezoneOffset` property allows you to specify the server's time zone offset from UTC in **hours** or **fractional hours**. This is useful when binding values from the server to ensure they are interpreted correctly on the client side.
2020

@@ -26,16 +26,15 @@ The `serverTimezoneOffset` property allows you to specify the server's time zone
2626

2727
N> The `serverTimezoneOffset` property is applicable **only for pre-bound values** (i.e., values set during initialization or data binding). It does **not affect** values selected by the user during runtime.
2828

29-
### Example
29+
{% if page.publishingplatform == "aspnet-core" %}
3030

31-
```ts
32-
import { DateTimePicker } from '@syncfusion/ej2-calendars';
31+
{% tabs %}
32+
{% include code-snippet/datetimepicker/timezone-cs1/tagHelper %}
33+
{% endtabs %}
3334

34-
/* Initialize the DateTimePicker component */
35-
let datetimepicker: DateTimePicker = new DateTimePicker({
36-
placeholder: "Select Date Time",
37-
width: "250px",
38-
serverTimezoneOffset: 5.5 // Example: UTC+5:30 for IST
39-
});
35+
{% elsif page.publishingplatform == "aspnet-mvc" %}
4036

41-
datetimepicker.appendTo('#datetimepicker');
37+
{% tabs %}
38+
{% include code-snippet/datetimepicker/timezone-cs1/razor %}
39+
{% endtabs %}
40+
{% endif %}

0 commit comments

Comments
 (0)