File

src/ui/viewer/components/field/wrappers/date-picker/smart-date-picker-wrapper.component.ts

Extends

AbstractInputWrapperComponent

Implements

OnInit OnDestroy

Metadata

Index

Properties
Methods
Inputs
Outputs

Constructor

constructor(helperService: SmartViewerHelperService<AbstractFrameComponent>, renderer: Renderer2, elementRef: ElementRef, smartConfig: SmartConfig)
Parameters :
Name Type Optional
helperService SmartViewerHelperService<AbstractFrameComponent> No
renderer Renderer2 No
elementRef ElementRef No
smartConfig SmartConfig No

Inputs

appendTo
Type : ViewContainerRef
buttons
Type : EditorButton[]
Default value : []
showDateTimeZone
Type : boolean
Default value : true
useDateTimeZones
Type : boolean
Default value : true
componentInstance
Type : any
contentStyle
Type : any
field
Type : any
fieldStyle
Type : any
hasAbsolutePosition
Type : boolean
isNumeric
Type : boolean
model
Type : any
selected
Type : any

Outputs

modelChange
Type : EventEmitter<any>

Methods

Public getDateFormat
getDateFormat()

Gets the effective date format.

Returns : string
Public getDateTimeTZPreferenceTooltip
getDateTimeTZPreferenceTooltip()

Gets the DATETIME-TZ preference tooltip.

Returns : string | null
Public getPickerValue
getPickerValue()

Gets the picker wall-clock value.

Returns : Date | null
Public getSelectedTimeZoneOffset
getSelectedTimeZoneOffset()

Gets the selected timezone offset.

Returns : string
Public getTimeZoneOptions
getTimeZoneOptions()

Gets timezone offset selector options.

Public isDateTimeTZSelectorPreferenceApplicable
isDateTimeTZSelectorPreferenceApplicable()

Determines whether this field can use the DATETIME-TZ usage preference.

Returns : boolean
Public normalizeModelToCurrentOffset
normalizeModelToCurrentOffset()

Normalizes the current DATETIME-TZ model value to the current offset.

Returns : void
Public onDatePickerBlurred
onDatePickerBlurred()

On date-picker blurred, resets the input if the date is incomplete

Returns : void
Public onDatePickerValueChanged
onDatePickerValueChanged(value: Date)

Updates the date value from the picker.

Parameters :
Name Type Optional Description
value Date No

The picker value.

Returns : void
Public onTimeZoneOffsetChanged
onTimeZoneOffsetChanged(offset: string)

Updates the selected timezone offset.

Parameters :
Name Type Optional Description
offset string No

The selected GMT offset.

Returns : void
Public resetDateTimeTZOffset
resetDateTimeTZOffset()

Resets the selected timezone offset to the current value default.

Returns : void
Public shouldRenderTimeZoneSelector
shouldRenderTimeZoneSelector()

Determines whether the timezone selector should be rendered.

Returns : boolean
Public shouldStripTimeZoneFormat
shouldStripTimeZoneFormat()

Determines whether timezone tokens should be stripped from the format.

Returns : boolean
Public shouldUseDateTimePicker
shouldUseDateTimePicker()

Determines whether the field should use the datetime picker.

Returns : boolean
Public shouldUseDateTimeZones
shouldUseDateTimeZones()

Determines whether DATETIME-TZ offset handling should be used.

Returns : boolean
Public updateValue
updateValue(newValue: any)
Parameters :
Name Type Optional
newValue any No
Returns : void

Properties

showDatePickerWeekNumbers
Type : unknown
Default value : false
vDateField
Type : DatePickerComponent | DateTimePickerComponent
Decorators :
@ViewChild('vDateField')
vDateFieldElement
Type : ElementRef
Decorators :
@ViewChild('vDateField', {read: ElementRef})
Public elementRef
Type : ElementRef
enabledStateDirective
Type : EnabledStateDirective
Decorators :
@ViewChild(EnabledStateDirective)
Public helperService
Type : SmartViewerHelperService<AbstractFrameComponent>
smartWidgetDirective
Type : InputFacadeDirective
Decorators :
@ViewChild(InputFacadeDirective)
<!--
**************************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") -                  *
* www.consultingwerk.com and other contributors as listed                *
* below. All Rights Reserved.                                            *
*                                                                        *
*  Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY        *
*   KIND, either express or implied.                                     *
*                                                                        *
*  Contributors:                                                         *
*                                                                        *
**************************************************************************

--------------------------------------------------------------------------
    File        : smart-date-picker-wrapper.component.html
    Purpose     : Template for Smart Date Picker Wrapper.
    Author(s)   : Radu Nicoara
    Created     : Jan 16, 2024
--------------------------------------------------------------------------
-->
<div class="form-field-div date-picker-wrapper">
    <div [class.smart-datetime-tz-picker-group]="shouldRenderTimeZoneSelector()">
    @if (!shouldUseDateTimePicker()) {
    <kendo-datepicker
        smart-widget
        #vDateField
        [popupSettings]="{ appendTo: appendTo }"
        [name]="field.fieldName"
        [format]="getDateFormat()"
        [enabledState]="field.enabledState"
        [value]="getPickerValue()"
        (focus)="helperService.inputFocused.next(field.fieldName)"
        (blur)="onDatePickerBlurred()"
        (valueChange)="onDatePickerValueChanged($event)"
        [weekNumber]="showDatePickerWeekNumbers"
        [attr.title]="getDateTimeTZPreferenceTooltip()"
        [attr.dataHelpUrl]="field.inputSettings.helpUrl"
        [ngClass]="{'no-date-value': !model, 'has-help-url': field.inputSettings.helpUrl}">
    </kendo-datepicker>
    } @else {
    <kendo-datetimepicker
        smart-widget
        #vDateField
        [popupSettings]="{ appendTo: appendTo }"
        [name]="field.fieldName"
        [format]="getDateFormat()"
        [enabledState]="field.enabledState"
        [value]="getPickerValue()"
        (focus)="helperService.inputFocused.next(field.fieldName)"
        (blur)="onDatePickerBlurred()"
        (valueChange)="onDatePickerValueChanged($event)"
        [weekNumber]="showDatePickerWeekNumbers"
        [calendarType]="'infinite'"
        [attr.title]="getDateTimeTZPreferenceTooltip()"
        [attr.dataHelpUrl]="field.inputSettings.helpUrl"
        [ngClass]="{'no-date-value': !model, 'has-help-url': field.inputSettings.helpUrl}">
    </kendo-datetimepicker>
    }
    @if (shouldRenderTimeZoneSelector()) {
        <kendo-dropdownlist
            class="smart-datetime-tz-selector"
            [data]="getTimeZoneOptions()"
            textField="text"
            valueField="value"
            [valuePrimitive]="true"
            [value]="getSelectedTimeZoneOffset()"
            [disabled]="disabled()"
            (valueChange)="onTimeZoneOffsetChanged($event)">
        </kendo-dropdownlist>
    }
    </div>
    @for (button of buttons; track button.key) {
        <button
            kendoButton
            [iconClass]="button.icon"
            [disabled]="disabled()"
            [smartEditorButton]="button"
            [standaloneEditorButton]="true"
            (editorButtonClicked)="handleEditorButtonClicked($event)">
            {{ button.label }}
        </button>
    }
</div>

./smart-date-picker-wrapper.component.scss

/**********************************************************************
 * Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") -              *
 * www.consultingwerk.com and other contributors as listed            *
 * below. All Rights Reserved.                                        *
 *                                                                    *
 *  Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY    *
 *   KIND, either express or implied.                                 *
 *                                                                    *
 *  Contributors:                                                     *
 *                                                                    *
 **********************************************************************/
/*------------------------------------------------------------------------
    File        : smart-date-picker-wrapper.component.scss
    Purpose     : Styles for Smart Date Picker Wrapper.
    Author(s)   : Oana Sucigan
    Created     : Jul 08, 2025
  ----------------------------------------------------------------------*/

::ng-deep .no-date-value.k-disabled,
::ng-deep .no-date-value:not(.k-focus) {
    .k-dateinput .k-input-inner {
        content-visibility: hidden !important;
    }
}

.date-picker-wrapper {
    display: flex;
    flex-direction: row;
    gap: var(--kendo-spacing-1, 0.25rem);

    > div {
        display: flex;
        flex: 1;
        min-width: 0;
    }

    kendo-datepicker,
    kendo-datetimepicker {
        flex: 1;
        min-width: 0;
    }

    .smart-datetime-tz-picker-group {
        gap: var(--kendo-spacing-1, 0.25rem);

        .smart-datetime-tz-selector {
            width: 7.5rem;
            flex: 0 0 7.5rem;
        }
    }
}

Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""