UmbDateOnly 16.2.1
dotnet add package UmbDateOnly --version 16.2.1
NuGet\Install-Package UmbDateOnly -Version 16.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UmbDateOnly" Version="16.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UmbDateOnly" Version="16.2.1" />
<PackageReference Include="UmbDateOnly" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add UmbDateOnly --version 16.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: UmbDateOnly, 16.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package UmbDateOnly@16.2.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=UmbDateOnly&version=16.2.1
#tool nuget:?package=UmbDateOnly&version=16.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
UmbDateOnly
The converter returns a System.DateOnly struct, which is just three integers (year, month, day) with no culture information attached. It's inherently culture-neutral. When Rendering in Views, the culture used depends on your formatting approach:
@* Uses current culture (site/user culture) *@
@Model.MyDatePicker
@* Explicit culture-invariant *@
@Model.MyDatePicker.ToString(CultureInfo.InvariantCulture)
@* Specific culture *@
@Model.MyDatePicker.ToString(new CultureInfo("da-DK"))
@* Custom format with current culture *@
@Model.MyDatePicker.ToString("dd MMMM yyyy")
@* Custom format with specific culture *@
@Model.MyDatePicker.ToString("dd MMMM yyyy", new CultureInfo("da-DK"))
How to use
- Install the package
- Add a new property on your document type
- Select DateOnly as editor
- (Optional) Enter custom configuration for the data type (e.g., YYYY-MM-DD, DD.MM.YYYY). Date formatting will only be applied in the backoffice
- Create some new content, using the DateOnly editor select a date for your property by clicking on the date picker, or use the button to auto-select today's date
- Render date on the front-end - @Model.YourDateProperty should return a DateTime object
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Umbraco.Cms.Core (>= 16.1.1)
- Umbraco.Cms.Web.Website (>= 16.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.