Skip to content

Commit 896b18f

Browse files
committed
Sync with Kendo UI Professional
1 parent 1cf4c1a commit 896b18f

File tree

6 files changed

+126
-51
lines changed

6 files changed

+126
-51
lines changed
10.3 KB
Loading

docs-aspnet/getting-started-core/REPL/repl-getting-started.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ By using the Telerik REPL for ASP.NET Core, you can write razor code that contai
1313

1414
* [Adding static assets](#adding-static-assets)
1515
* [Customizing the visual theme](#customizing-the-theme)
16+
* [Adding snippets](#adding-snippets)
1617
* [Rendering HTML](#rendering-html)
1718
* [Using Razor code blocks](#using-razor-code-blocks)
1819
* [Using Razor local methods](#using-razor-local-methods)
@@ -34,6 +35,14 @@ To change the theme for the {{site.product}} components, select a new theme from
3435

3536
![{{ site.product_short }} REPL Theme Manager](../../getting-started-core/REPL/images/repl-theme-manager.png)
3637

38+
## Adding Snippets
39+
40+
The Telerik REPL for ASP.NET Core provides a list of predefined code snippets for fast UI component reference and configuration.
41+
42+
The basic snippets are listed in the Snippets section of the REPL Sidebar. You can browse to find the desired snippet and use both the `HtmlHelper` or `TagHelper` flavour of the snippet.
43+
44+
![{{ site.product_short }} REPL Snippets](../../getting-started-core/REPL/images/repl-built-in-snippets.png)
45+
3746
## Rendering HTML
3847

3948
By using the Telerik REPL for ASP.NET Core, you can render plain HTML:

docs-aspnet/getting-started-core/REPL/using-with-ui-for-aspnet-core.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To open an existing {{site.product}} demo in the Telerik REPL:
1818
1. Navigate to the [{{site.product}} Demos website](https://demos.telerik.com/aspnet-core/).
1919
1. Select the desired demo, and then click **Edit in Telerik REPL**.
2020

21-
![{{ site.product_short }} Running a demo in REPL](../../getting-started-core/repl/images/repl-run-demo.png)
21+
![{{ site.product_short }} Running a demo in REPL](../../getting-started-core/REPL/images/repl-run-demo.png)
2222

2323
## Using Predefined Models
2424

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Dynamically Setting Min Date and Time for Kendo UI DateTimePicker
3+
description: Learn how to dynamically set the minimum date and time for a Kendo UI DateTimePicker based on another DateTimePicker's selection.
4+
type: how-to
5+
page_title: How to Set Min Date and Time Based on Another DateTimePicker's Selection in Kendo UI
6+
slug: dynamically-set-min-date-time-kendo-datetimepicker
7+
tags: kendo-ui, datetimepicker, min-date, setoptions, javascript
8+
res_type: kb
9+
ticketid: 1674797
10+
---
11+
12+
## Description
13+
14+
When using two [Kendo UI for jQuery DateTimePicker](https://docs.telerik.com/kendo-ui/api/javascript/ui/datetimepicker) components for start and end date selections, it's necessary to update the minimum selectable date and time of the end date picker based on the selection in the start date picker. This ensures that the end date cannot precede the start date.
15+
16+
This knowledge base article also answers the following questions:
17+
- How to dynamically change the minimum date of a DateTimePicker based on another DateTimePicker's value?
18+
- How to use the setOptions method to update DateTimePicker settings?
19+
- How to synchronize two DateTimePicker controls to ensure logical date and time selection?
20+
21+
## Solution
22+
23+
To dynamically set the minimum date and time for the end date DateTimePicker based on the start date DateTimePicker's selection, use the `change` event of the start date DateTimePicker. Within this event, retrieve the selected date and time, and then use the `setOptions` method to update the minimum date (`min`) and start time (`startTime`) of the end date DateTimePicker.
24+
25+
Here's an example of how to implement this:
26+
27+
```javascript
28+
// Assuming shiftStart and shiftEnd are your DateTimePicker instances
29+
shiftStart.kendoDateTimePicker({
30+
timeFormat: "HH:mm",
31+
format: "dd MMM yyyy HH:mm",
32+
min: new Date(vYear, vMonth - 1, vDay, vHour, vMin),
33+
interval: 15,
34+
change: function() {
35+
var startDT = this.value();
36+
var year = startDT.getFullYear();
37+
var month = startDT.getMonth();
38+
var day = startDT.getDate();
39+
var vHour = startDT.getHours();
40+
var vMin = startDT.getMinutes();
41+
shiftEnd.data("kendoDateTimePicker").setOptions({
42+
min: new Date(year, month, day, vHour, vMin),
43+
startTime: new Date(year, month, day, vHour, vMin)
44+
});
45+
}
46+
});
47+
48+
shiftEnd.kendoDateTimePicker({
49+
timeFormat: "HH:mm",
50+
format: "dd MMM yyyy HH:mm",
51+
min: new Date(vYear, vMonth - 1, vDay, vHour, vMin),
52+
interval: 15
53+
});
54+
```
55+
56+
This code snippet demonstrates how to configure the `shiftStart` DateTimePicker to update the `shiftEnd` DateTimePicker's `min` and `startTime` options upon a change.
57+
58+
## See Also
59+
60+
- [Kendo UI DateTimePicker Documentation](https://docs.telerik.com/kendo-ui/api/javascript/ui/datetimepicker)
61+
- [Kendo UI DateTimePicker setOptions Method](https://docs.telerik.com/kendo-ui/api/javascript/ui/datetimepicker/methods/setoptions)
62+
- [Example of Synchronizing Two DateTimePickers](https://dojo.telerik.com/dXCVgCOv)

package-lock.json

Lines changed: 47 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
"version": "1.0.0",
1212
"devDependencies": {
1313
"@progress/kendo-svg-icons": "4.0.0",
14-
"@progress/kendo-theme-bootstrap": "10.1.0",
15-
"@progress/kendo-theme-classic": "10.1.0",
16-
"@progress/kendo-theme-core": "10.1.0",
17-
"@progress/kendo-theme-default": "10.1.0",
18-
"@progress/kendo-theme-fluent": "10.1.0",
19-
"@progress/kendo-theme-material": "10.1.0",
20-
"@progress/kendo-theme-utils": "10.1.0",
14+
"@progress/kendo-theme-bootstrap": "10.2.0",
15+
"@progress/kendo-theme-classic": "10.2.0",
16+
"@progress/kendo-theme-core": "10.2.0",
17+
"@progress/kendo-theme-default": "10.2.0",
18+
"@progress/kendo-theme-fluent": "10.2.0",
19+
"@progress/kendo-theme-material": "10.2.0",
20+
"@progress/kendo-theme-utils": "10.2.0",
2121
"@progress/wct-a11y-spec": "^2.0.9",
2222
"@rollup/plugin-node-resolve": "^13.3.0",
2323
"@rollup/plugin-virtual": "^2.1.0",

0 commit comments

Comments
 (0)