From 0422d979e5ce5318c1b5a55b963ebcdf73c8053d Mon Sep 17 00:00:00 2001 From: KaviBharathi-SF5060 Date: Wed, 3 Sep 2025 13:18:45 +0530 Subject: [PATCH 1/4] 966391: updated the md files and code snippets --- .../datepicker/timezone-cs1/razor | 9 ++++++ .../datepicker/timezone-cs1/tagHelper | 7 +++++ .../datepicker/timezone-cs1/timezone.cs | 18 ++++++++++++ .../datetimepicker/timezone-cs1/razor | 9 ++++++ .../datetimepicker/timezone-cs1/tagHelper | 7 +++++ .../datetimepicker/timezone-cs1/timezone.cs | 18 ++++++++++++ .../EJ2_ASP.MVC/timezone-behavior.md | 29 ++++++++++++------- .../EJ2_ASP.NETCORE/timezone-behavior.md | 29 ++++++++++++------- .../EJ2_ASP.MVC/timezone-behavior.md | 27 ++++++++++------- .../EJ2_ASP.NETCORE/timezone-behavior.md | 29 ++++++++++++------- 10 files changed, 139 insertions(+), 43 deletions(-) create mode 100644 ej2-asp-core-mvc/code-snippet/datepicker/timezone-cs1/razor create mode 100644 ej2-asp-core-mvc/code-snippet/datepicker/timezone-cs1/tagHelper create mode 100644 ej2-asp-core-mvc/code-snippet/datepicker/timezone-cs1/timezone.cs create mode 100644 ej2-asp-core-mvc/code-snippet/datetimepicker/timezone-cs1/razor create mode 100644 ej2-asp-core-mvc/code-snippet/datetimepicker/timezone-cs1/tagHelper create mode 100644 ej2-asp-core-mvc/code-snippet/datetimepicker/timezone-cs1/timezone.cs diff --git a/ej2-asp-core-mvc/code-snippet/datepicker/timezone-cs1/razor b/ej2-asp-core-mvc/code-snippet/datepicker/timezone-cs1/razor new file mode 100644 index 0000000000..7c643cd891 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/datepicker/timezone-cs1/razor @@ -0,0 +1,9 @@ +@{ + var serverTimezoneOffset = 5.5; + var initialDate = new Date(); +} + +@Html.EJS().DatePicker("datepicker") + .ServerTimezoneOffset(serverTimezoneOffset) + .Value(initialDate) + .Render() diff --git a/ej2-asp-core-mvc/code-snippet/datepicker/timezone-cs1/tagHelper b/ej2-asp-core-mvc/code-snippet/datepicker/timezone-cs1/tagHelper new file mode 100644 index 0000000000..79f54501f7 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/datepicker/timezone-cs1/tagHelper @@ -0,0 +1,7 @@ + +@{ + var serverTimezoneOffset = 5.5; + var initialDate = new Date(); +} + + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/datepicker/timezone-cs1/timezone.cs b/ej2-asp-core-mvc/code-snippet/datepicker/timezone-cs1/timezone.cs new file mode 100644 index 0000000000..a4db34d06a --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/datepicker/timezone-cs1/timezone.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace EJ2CoreSampleBrowser.Controllers +{ + public class HomeController : Controller + { + public ActionResult Datepicker() + { + ViewBag.serverTimezoneOffset=5.5; + ViewBag.initalDate=new Date(); + return View(); + } + } +} diff --git a/ej2-asp-core-mvc/code-snippet/datetimepicker/timezone-cs1/razor b/ej2-asp-core-mvc/code-snippet/datetimepicker/timezone-cs1/razor new file mode 100644 index 0000000000..0de998bc68 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/datetimepicker/timezone-cs1/razor @@ -0,0 +1,9 @@ +@{ + var serverTimezoneOffset = 5.5; + var initialDate = new Date(); +} + +@Html.EJS().DateTimePicker("datetimepicker") + .ServerTimezoneOffset(serverTimezoneOffset) + .Value(initialDate) + .Render() diff --git a/ej2-asp-core-mvc/code-snippet/datetimepicker/timezone-cs1/tagHelper b/ej2-asp-core-mvc/code-snippet/datetimepicker/timezone-cs1/tagHelper new file mode 100644 index 0000000000..79f54501f7 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/datetimepicker/timezone-cs1/tagHelper @@ -0,0 +1,7 @@ + +@{ + var serverTimezoneOffset = 5.5; + var initialDate = new Date(); +} + + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/datetimepicker/timezone-cs1/timezone.cs b/ej2-asp-core-mvc/code-snippet/datetimepicker/timezone-cs1/timezone.cs new file mode 100644 index 0000000000..789ffb657a --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/datetimepicker/timezone-cs1/timezone.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace EJ2CoreSampleBrowser.Controllers +{ + public class HomeController : Controller + { + public ActionResult DateTimepicker() + { + ViewBag.serverTimezoneOffset=5.5; + ViewBag.initalDate=new Date(); + return View(); + } + } +} diff --git a/ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md b/ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md index 9effedceeb..abbadd5267 100644 --- a/ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md +++ b/ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md @@ -28,14 +28,21 @@ N> The `serverTimezoneOffset` property is applicable **only for pre-bound values ### Example -```ts -import { DatePicker } from '@syncfusion/ej2-calendars'; - -/* Initialize the DatePicker component */ -let datepicker: DatePicker = new DatePicker({ - placeholder: "Select Date", - width: "250px", - serverTimezoneOffset: 5.5 // Example: UTC+5:30 for IST -}); - -datepicker.appendTo('#datepicker'); +{% if page.publishingplatform == "aspnet-core" %} + +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/datepicker/timezone-cs1/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="timezone.cs" %} +{% endhighlight %}{% endtabs %} + +{% elsif page.publishingplatform == "aspnet-mvc" %} + +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/datepicker/timezone-cs1/razor %} +{% endhighlight %} +{% highlight c# tabtitle="timezone.cs" %} +{% endhighlight %}{% endtabs %} +{% endif %} \ No newline at end of file diff --git a/ej2-asp-core-mvc/datepicker/EJ2_ASP.NETCORE/timezone-behavior.md b/ej2-asp-core-mvc/datepicker/EJ2_ASP.NETCORE/timezone-behavior.md index 9effedceeb..6f4b91bf19 100644 --- a/ej2-asp-core-mvc/datepicker/EJ2_ASP.NETCORE/timezone-behavior.md +++ b/ej2-asp-core-mvc/datepicker/EJ2_ASP.NETCORE/timezone-behavior.md @@ -28,14 +28,21 @@ N> The `serverTimezoneOffset` property is applicable **only for pre-bound values ### Example -```ts -import { DatePicker } from '@syncfusion/ej2-calendars'; - -/* Initialize the DatePicker component */ -let datepicker: DatePicker = new DatePicker({ - placeholder: "Select Date", - width: "250px", - serverTimezoneOffset: 5.5 // Example: UTC+5:30 for IST -}); - -datepicker.appendTo('#datepicker'); +{% if page.publishingplatform == "aspnet-core" %} + +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/datepicker/timezone-cs1/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="timezone.cs" %} +{% endhighlight %}{% endtabs %} + +{% elsif page.publishingplatform == "aspnet-mvc" %} + +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/datepicker/timezone-cs1/razor %} +{% endhighlight %} +{% highlight c# tabtitle="timezone.cs" %} +{% endhighlight %}{% endtabs %} +{% endif %} diff --git a/ej2-asp-core-mvc/datetimepicker/EJ2_ASP.MVC/timezone-behavior.md b/ej2-asp-core-mvc/datetimepicker/EJ2_ASP.MVC/timezone-behavior.md index e41385de28..bf90458835 100644 --- a/ej2-asp-core-mvc/datetimepicker/EJ2_ASP.MVC/timezone-behavior.md +++ b/ej2-asp-core-mvc/datetimepicker/EJ2_ASP.MVC/timezone-behavior.md @@ -14,7 +14,7 @@ The DateTimePicker component displays and maintains the selected date and time v 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. -## `serverTimezoneOffset` +## serverTimezoneOffset 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. @@ -28,14 +28,21 @@ N> The `serverTimezoneOffset` property is applicable **only for pre-bound values ### Example -```ts -import { DateTimePicker } from '@syncfusion/ej2-calendars'; +{% if page.publishingplatform == "aspnet-core" %} -/* Initialize the DateTimePicker component */ -let datetimepicker: DateTimePicker = new DateTimePicker({ - placeholder: "Select Date Time", - width: "250px", - serverTimezoneOffset: 5.5 // Example: UTC+5:30 for IST -}); +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/datetimepicker/timezone-cs1/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="timezone.cs" %} +{% endhighlight %}{% endtabs %} -datetimepicker.appendTo('#datetimepicker'); +{% elsif page.publishingplatform == "aspnet-mvc" %} + +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/datetimepicker/timezone-cs1/razor %} +{% endhighlight %} +{% highlight c# tabtitle="timezone.cs" %} +{% endhighlight %}{% endtabs %} +{% endif %} diff --git a/ej2-asp-core-mvc/datetimepicker/EJ2_ASP.NETCORE/timezone-behavior.md b/ej2-asp-core-mvc/datetimepicker/EJ2_ASP.NETCORE/timezone-behavior.md index 0dd0647856..8eca3b6317 100644 --- a/ej2-asp-core-mvc/datetimepicker/EJ2_ASP.NETCORE/timezone-behavior.md +++ b/ej2-asp-core-mvc/datetimepicker/EJ2_ASP.NETCORE/timezone-behavior.md @@ -28,14 +28,21 @@ N> The `serverTimezoneOffset` property is applicable **only for pre-bound values ### Example -```ts -import { DateTimePicker } from '@syncfusion/ej2-calendars'; - -/* Initialize the DateTimePicker component */ -let datetimepicker: DateTimePicker = new DateTimePicker({ - placeholder: "Select Date Time", - width: "250px", - serverTimezoneOffset: 5.5 // Example: UTC+5:30 for IST -}); - -datetimepicker.appendTo('#datetimepicker'); \ No newline at end of file +{% if page.publishingplatform == "aspnet-core" %} + +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/datetimepicker/timezone-cs1/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="timezone.cs" %} +{% endhighlight %}{% endtabs %} + +{% elsif page.publishingplatform == "aspnet-mvc" %} + +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/datetimepicker/timezone-cs1/razor %} +{% endhighlight %} +{% highlight c# tabtitle="timezone.cs" %} +{% endhighlight %}{% endtabs %} +{% endif %} \ No newline at end of file From c2222a5db569e715bbafb25c6ac8e5f6a944c86c Mon Sep 17 00:00:00 2001 From: KaviBharathi-SF5060 Date: Wed, 3 Sep 2025 14:56:41 +0530 Subject: [PATCH 2/4] resolved the file mapping --- ej2-asp-core-toc.html | 2 ++ ej2-asp-mvc-toc.html | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ej2-asp-core-toc.html b/ej2-asp-core-toc.html index 103870e62d..8a54e7657e 100644 --- a/ej2-asp-core-toc.html +++ b/ej2-asp-core-toc.html @@ -788,6 +788,7 @@
  • Start and Depth View
  • Accessibility
  • Style and Appearance
  • +
  • Timezone Behavior
  • How To
    • Disabled the DatePicker Component
    • @@ -844,6 +845,7 @@
    • Globalization
    • Accessibility
    • Style and Appearance
    • +
    • Timezone Behavior
    • How To
      • Disable the DateTimePicker Component
      • diff --git a/ej2-asp-mvc-toc.html b/ej2-asp-mvc-toc.html index 29f38c607c..36de1d756d 100644 --- a/ej2-asp-mvc-toc.html +++ b/ej2-asp-mvc-toc.html @@ -740,6 +740,7 @@
      • Start and Depth View
      • Accessibility
      • Style and Appearance
      • +
      • Timezone Behavior
      • How To
        • Disabled the DatePicker Component
        • @@ -794,6 +795,7 @@
        • Globalization
        • Accessibility
        • Style and Appearance
        • +
        • Timezone Behavior
        • How To
          • Disable the DateTimePicker Component
          • From a947f1e28d60a91d55446fb95fb250f50c128413 Mon Sep 17 00:00:00 2001 From: KaviBharathi-SF5060 Date: Wed, 3 Sep 2025 17:45:36 +0530 Subject: [PATCH 3/4] Update timezone-behavior.md --- .../EJ2_ASP.MVC/timezone-behavior.md | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md b/ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md index abbadd5267..510f96bef8 100644 --- a/ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md +++ b/ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md @@ -25,24 +25,3 @@ The `serverTimezoneOffset` property allows you to specify the server's time zone - `5.5` → UTC+5:30 (India Standard Time) 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. - -### Example - -{% if page.publishingplatform == "aspnet-core" %} - -{% tabs %} -{% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/datepicker/timezone-cs1/tagHelper %} -{% endhighlight %} -{% highlight c# tabtitle="timezone.cs" %} -{% endhighlight %}{% endtabs %} - -{% elsif page.publishingplatform == "aspnet-mvc" %} - -{% tabs %} -{% highlight razor tabtitle="CSHTML" %} -{% include code-snippet/datepicker/timezone-cs1/razor %} -{% endhighlight %} -{% highlight c# tabtitle="timezone.cs" %} -{% endhighlight %}{% endtabs %} -{% endif %} \ No newline at end of file From 5a662841f905723b0e00cbd5c6246449336e357a Mon Sep 17 00:00:00 2001 From: KaviBharathi-SF5060 Date: Wed, 3 Sep 2025 18:14:25 +0530 Subject: [PATCH 4/4] Update timezone-behavior.md --- .../EJ2_ASP.MVC/timezone-behavior.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md b/ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md index 510f96bef8..4618644478 100644 --- a/ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md +++ b/ej2-asp-core-mvc/datepicker/EJ2_ASP.MVC/timezone-behavior.md @@ -25,3 +25,22 @@ The `serverTimezoneOffset` property allows you to specify the server's time zone - `5.5` → UTC+5:30 (India Standard Time) 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. + +{% if page.publishingplatform == "aspnet-core" %} + +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/datepicker/timezone-cs1/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="timezone.cs" %} +{% endhighlight %}{% endtabs %} + +{% elsif page.publishingplatform == "aspnet-mvc" %} + +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/datepicker/timezone-cs1/razor %} +{% endhighlight %} +{% highlight c# tabtitle="timezone.cs" %} +{% endhighlight %}{% endtabs %} +{% endif %}