DateTime elements

A DateTimeFormElement writes an <input> element type="text" with the right classes to the output. To represent a date/time picker it uses the Eonasdan datetimepicker JQuery plugin. See DateTimeFormElementConfiguration for configuration options.

Element and builder

The DateTimeFormElement has an equivalent DateTimeFormElementBuilder. A builder can be created using factory methods.

DateTimeFormElement attributes

Attribute Description Default


A Date, LocalDate, LocalTime, LocalDateTime or null value can be provided

Null be default


A DateTimeFormElementConfiguration can be provided

Null be default


Requires a DateTimeFormElementConfiguration.Format to set the format. A few helper methods are provided to set the format such as datetime, date and time.

Not set by default


Simple datepicker

import static com.foreach.across.modules.bootstrapui.ui.factories.BootstrapViewElements.bootstrap;
    .value( new Date() )

Localized fr_FR Date

import static com.foreach.across.modules.bootstrapui.ui.factories.BootstrapViewElements.bootstrap;

DateTimeFormElementBuilder builder = datetime();
DateTimeFormElementConfiguration config = builder.getConfiguration();
config.setLocale( Locale.forLanguageTag( "fr-FR" ) );
config.setFormat( DateTimeFormElementConfiguration.Format.DATETIME_FULL );
config.setLocalizePatterns( false );

        .configuration( config )
        .value( )