You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blazor/timepicker/getting-started.md
+37-79Lines changed: 37 additions & 79 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,7 @@ documentation: ug
9
9
10
10
# Getting Started with Blazor TimePicker Component
11
11
12
-
This section briefly explains about how to include [Blazor TimePicker](https://www.syncfusion.com/blazor-components/blazor-timepicker) component in a Blazor WebAssembly App using [Visual Studio](https://visualstudio.microsoft.com/vs/), [Visual Studio Code](https://code.visualstudio.com/), and the [.NET CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/).
13
-
14
-
To get start quickly with Blazor TimePicker component, refer to this [GitHub](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/TimePicker) sample.
12
+
This section briefly explains about how to include [Syncfusion<supstyle="font-size:70%">®</sup> Blazor TimePicker](https://www.syncfusion.com/blazor-components/blazor-timepicker) component in a Blazor WebAssembly App using [Visual Studio](https://visualstudio.microsoft.com/vs/), [Visual Studio Code](https://code.visualstudio.com/), and the [.NET CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/).
15
13
16
14
{% tabcontents %}
17
15
@@ -25,23 +23,6 @@ To get start quickly with Blazor TimePicker component, refer to this [GitHub](ht
25
23
26
24
Create a **Blazor WebAssembly App** using Visual Studio via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-10.0&pivots=vs) or the [Syncfusion<supstyle="font-size:70%">®</sup> Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio). For detailed instructions, refer to the [Blazor WASM App Getting Started](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-app) documentation.
## Install Syncfusion<supstyle="font-size:70%">®</sup> Blazor Calendars and Themes NuGet in the App
31
-
32
-
To add the **Blazor TimePicker** component in the app, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), then search and install [Syncfusion.Blazor.Calendars](https://www.nuget.org/packages/Syncfusion.Blazor.Calendars) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/). Alternatively, run the following commands in the Package Manager Console to achieve the same.
N> Syncfusion<supstyle="font-size:70%">®</sup> Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to the [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for the available NuGet packages list with component details.
Create a **Blazor WebAssembly App** using Visual Studio Code via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-10.0&pivots=vsc) or the [Syncfusion<supstyle="font-size:70%">®</sup> Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-code-integration/create-project). For detailed instructions, refer to the [Blazor WASM App Getting Started](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-app?tabcontent=visual-studio-code) documentation.
56
37
57
-
Alternatively, create a WebAssembly application by using the following command in the integrated terminal(<kbd>Ctrl</kbd>+<kbd>`</kbd>).
38
+
Alternatively, create a WebAssembly application by using the following command in the integrated terminal(<kbd>Ctrl</kbd>+<kbd>`</kbd>).
58
39
59
40
{% tabs %}
60
41
@@ -67,26 +48,6 @@ cd BlazorApp
67
48
68
49
{% endtabs %}
69
50
70
-
## Install Syncfusion<supstyle="font-size:70%">®</sup> Blazor Calendars and Themes NuGet in the App
71
-
72
-
* Press <kbd>Ctrl</kbd>+<kbd>`</kbd> to open the integrated terminal in Visual Studio Code.
73
-
* Ensure in the project root directory where the `.csproj` file is located.
74
-
* Run the following command to install the [Syncfusion.Blazor.Calendars](https://www.nuget.org/packages/Syncfusion.Blazor.Calendars) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet packages and ensure all dependencies are installed.
N> Syncfusion<supstyle="font-size:70%">®</sup> Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to the [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for the available NuGet packages list with component details.
89
-
90
51
{% endtabcontent %}
91
52
92
53
{% tabcontent .NET CLI %}
@@ -105,7 +66,7 @@ dotnet --version
105
66
106
67
## Create a Blazor WebAssembly App using .NET CLI
107
68
108
-
Run the following command to create a new Blazor WebAssembly App in a command prompt (Windows) or terminal (macOS) or command shell (Linux). For detailed instructions, refer to [this Blazor WASM App Getting Started](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-app?tabcontent=.net-cli) documentation.
69
+
Run the following command to create a new Blazor WebAssembly App in a command prompt (Windows) or terminal (macOS) or command shell (Linux). For detailed instructions, refer to the [Blazor WASM App Getting Started](https://blazor.syncfusion.com/documentation/getting-started/blazor-webassembly-app?tabcontent=.net-cli) documentation.
109
70
110
71
{% tabs %}
111
72
{% highlight c# tabtitle=".NET CLI" %}
@@ -116,29 +77,30 @@ cd BlazorApp
116
77
{% endhighlight %}
117
78
{% endtabs %}
118
79
119
-
## Install Syncfusion<supstyle="font-size:70%">®</sup> Blazor Calendars and Themes NuGet in the App
80
+
{% endtabcontent %}
81
+
82
+
{% endtabcontents %}
120
83
121
-
To add the **Blazor TimePicker** component to the application, run the following commands in a command prompt (Windows), command shell (Linux), or terminal (macOS) to install the [Syncfusion.Blazor.Calendars](https://www.nuget.org/packages/Syncfusion.Blazor.Calendars/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet packages. See [Install and manage packages using the dotnet CLI](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-dotnet-cli) for more details.
Install [Syncfusion.Blazor.Calendars](https://www.nuget.org/packages/Syncfusion.Blazor.Calendars/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet packages in your project using the NuGet Package Manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), or the integrated terminal in Visual Studio Code (`dotnet add package`), or the .NET CLI.
87
+
88
+
Alternatively, run the following commands in the Package Manager Console to achieve the same.
N> Syncfusion<supstyle="font-size:70%">®</sup> Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to the [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for the available NuGet packages list with component details.
134
-
135
-
{% endtabcontent %}
136
-
137
-
{% endtabcontents %}
99
+
N> All Syncfusion Blazor packages are available on [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). See the [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for details.
138
100
139
-
## Add Import Namespaces
101
+
## Add import namespaces
140
102
141
-
Open the **~/_Imports.razor** file and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Calendars` namespaces.
103
+
After the packages are installed, open the **~/_Imports.razor** file and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Calendars` namespaces.
142
104
143
105
{% tabs %}
144
106
{% highlight C# tabtitle="~/_Imports.razor" %}
@@ -149,50 +111,42 @@ Open the **~/_Imports.razor** file and import the `Syncfusion.Blazor` and `Syncf
149
111
{% endhighlight %}
150
112
{% endtabs %}
151
113
152
-
## Register Syncfusion<supstyle="font-size:70%">®</sup> Blazor Service
114
+
## Register Syncfusion<supstyle="font-size:70%">®</sup> Blazor service
153
115
154
-
Register the Syncfusion<supstyle="font-size:70%">®</sup> Blazor Service in the **~/Program.cs** file of the Blazor WebAssembly App.
116
+
Register the Syncfusion<supstyle="font-size:70%">®</sup> Blazor service in the **Program.cs** file of your Blazor WebAssembly App.
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
168
-
123
+
....
169
124
builder.Services.AddSyncfusionBlazor();
170
-
await builder.Build().RunAsync();
171
125
....
172
126
173
127
{% endhighlight %}
174
128
{% endtabs %}
175
129
176
130
## Add stylesheet and script resources
177
131
178
-
The theme stylesheet and script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet and script references within the `<head>` section of the **~/index.html** file.
132
+
The theme stylesheet and script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet and script references in the **~/index.html** file.
N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to discover various methods ([Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets), [CDN](https://blazor.syncfusion.com/documentation/appearance/themes#cdn-reference), and [CRG](https://blazor.syncfusion.com/documentation/common/custom-resource-generator)) for referencing themes in Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in Blazor application.
142
+
N> Check out the [Blazor Themes](https://blazor.syncfusion.com/documentation/appearance/themes) topic to discover various methods ([Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets), [CDN](https://blazor.syncfusion.com/documentation/appearance/themes#cdn-reference), and [CRG](https://blazor.syncfusion.com/documentation/common/custom-resource-generator)) for referencing themes in the Blazor application. Also, check out the [Adding Script Reference](https://blazor.syncfusion.com/documentation/common/adding-script-references) topic to learn different approaches for adding script references in the Blazor application.
Add the Syncfusion<supstyle="font-size:70%">®</sup> Blazor TimePicker component in the **~/Pages/Index.razor** file.
193
147
194
148
{% tabs %}
195
-
{% highlight razor %}
149
+
{% highlight razor tabtitle="Index.razor" %}
196
150
197
151
<SfTimePickerTValue="DateTime?"PlaceHolder="Select a time"></SfTimePicker>
198
152
@@ -210,7 +164,9 @@ Time format is a way of representing the time value in different string format i
210
164
The below code demonstrates how to render TimePicker component in 24 hours Format with 60 minutes interval. The time interval is set to 60 minutes by using the [Step](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Calendars.SfTimePicker-1.html#Syncfusion_Blazor_Calendars_SfTimePicker_1_Step) property.
@@ -223,7 +179,9 @@ The below code demonstrates how to render TimePicker component in 24 hours Forma
223
179
224
180
{% previewsample "https://blazorplayground.syncfusion.com/embed/LXVpXCUtfRjicUbp?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor TimePicker with Time Format](./images/blazor-timepicker-time-format.png)" %}
225
181
226
-
## See Also
182
+
N> [View sample in GitHub](https://github.com/SyncfusionExamples/Blazor-Getting-Started-Examples/tree/main/TimePicker).
183
+
184
+
## See also
227
185
228
186
*[Getting Started with Syncfusion<supstyle="font-size:70%">®</sup> Blazor for Client-Side in .NET Core CLI](../getting-started/getting-started/blazor-webassembly-app)
229
187
*[Getting Started with Syncfusion<supstyle="font-size:70%">®</sup> Blazor for Server-side in Visual Studio](../getting-started/blazor-server-side-visual-studio)
0 commit comments