Confinity Documentation
  • Latest Version
  • Latest Version
  • Getting Started

    • Introduction
    • Core Concepts
    • Create an Application
    • Glossary
  • Essentials

    • Authentication & SSO
    • Breaking Changes
    • Roslyn Source Analyzers
    • Changelog
    • ConfinityContent
    • ConfinitySelectable
    • Confinity Schedules
    • Data Seeding
    • Development guidelines [WIP]
    • Entity App
    • Entity Form
    • Entity Permissions
    • Frontend Configuration
    • Images
    • Known Issues
    • Localization
    • Migrations
    • Modules [WIP]
    • On-Site Editing
    • Settings
    • Cascade Delete
    • Replication
    • Infrastructure
  • Modules

    • Analytics Module
    • Assets Module
    • Blog Module
    • Cookie Consent Module
    • Forms Module
    • Friendly Captcha (Forms Module )
    • GeoIP Module
    • Htmx
    • Mail Module
    • Mailing Module
    • MediaPlayer Module
    • GoogleMyBusiness Module
    • OpenTelemetry Module
    • Pages Module [WIP]
    • Pattern Library Module
    • SIX Saferpay (worldline) Module
    • Products Module
    • Search Module
    • Wizard Module
  • Guides

    • Create a Custom Entity App Form Element
    • Date and Time
    • Entity Change Listener
    • File Upload / Temp File
    • HTTP security headers
    • conventions [WIP]
    • How to use Confinity with nginx
    • Notifications
    • Nullability
    • Rename Entity
    • Schedules
    • Useful snippets
    • Content Localization
  • Design Guidelines

    • Introduction
    • Page Components
    • Forms Module

Date and Time

Date

Confinity's Entity App supports DateTime and DateTimeOffset for inputting dates, times and both together.

Use the AddDateAndTime method to configure a input.


private void EventFormConfig(IFormLayoutBuilder<Event> form)
{
    form.AddTab(tab =>
    {
        tab.AddDateAndTime(e => e.EventStart);
    });
}

Not all types are supported or recommended for DateTime and DateTimeOffset, see below for details.

TypeDateTimeDateTimeOffset
Date✔❌
Time✔❌
DateTimeLocal⁎✔

⁎ For saving a point in time it is recommended to use DateTimeOffset to ensure correct handling in different timezones.

DateOnly / TimeOnly

Use DateOnly and TimeOnly when when not the whole Date is used.


private void EventFormConfig(IFormLayoutBuilder<Pet> form)
{
    form.AddTab(tab =>
    {
        tab.AddDateOnly(p => p.DateOfBirth);

        tab.AddTimeOnly(p => p.WakesUpAt);
    });
}

Prev
Create a Custom Entity App Form Element
Next
Entity Change Listener