Salla Docs
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Salla - Opensource
Salla - Developers Community
  1. Form
  • Overview
  • Usage
  • Components Customization
  • Elements
    • Apps Icons
    • Breadcrumb
    • Color Picker
    • Conditional Fields
    • Count Down
    • Filters
    • Infinite Scroll
    • List Tile
    • Loading
    • Map
    • Modal
    • Placeholder
    • Progress Bar
    • Rating Stars
    • Reviews
    • Reviews Summary
    • Sheet
    • Skeleton
    • Slider
    • Social
    • Social Share
    • Tabs
  • Form
    • Button
    • Bottom Alert
    • Contacts
    • Date Time Picker
    • File Upload
    • Menu
    • Quantity Input
    • Select
    • Tel Input
  • Product
    • Add Product
    • Advertisement
    • Comments
    • Conditional Offer
    • Gifting
    • Installment
    • Meta Data
    • Offer
    • Offer Modal
    • Orders
    • Payments
    • Product Availability
    • Product Card
    • Products List
    • Product Options
    • Product Size Guide
    • Products Slider
    • Quick Buy
    • Quick Order
    • Scopes
    • Search
  • User
    • Cart Summary
    • Localization
    • Login
    • Loyalty
    • Rating
    • User Menu
    • User Profile
    • User Settings
    • Verify
  1. Form

Date Time Picker

The <salla-datetime-picker> web component is used to allow users to select both date and time with the same control. The date and time can be entered directly in the format of the current locale or through the Date Time Picker’s visible overlay.

Example#

Date Time Picker

Usage#

HTML

Properties#

PropertyAttributeDescriptionTypeDefault
Allow Inputallow-inputAllows the user to enter a date directly into the input field.booleanfalse
Allow Invalid Preloadallow-invalid-preloadAllows the preloading of an invalid date. When disabled, the field will be cleared if the provided date is invalidbooleanfalse
Alternative Formatalt-formatExactly the same as date format, but for the altInput field.string"F j, Y"
Alternative Inputalt-inputDisplays to the user a readable date (as per altFormat), but return something totally different to the server.booleanfalse
Alternative Input Classalt-input-classAdds to the input element created by the altInput option. Note that altInput already inherits classes from the original input.stringundefined
Append To--Appends the calendar to the specified node Instead of body.HTMLElementundefined
Aria Date Formataria-date-formatDefines how the date will be formatted in the aria-label for calendar days, using the same tokens as dateFormat. If this is changed, choose a value that will make sense when a screen reader reads it out loud.string"F j, Y"
Auto Fill Default Timeauto-fill-default-timeWhether or not the default time should be auto-filled when the input is empty and gains / loses focus when entered.booleantrue
Click Opensclick-opensWhether or not clicking on the input should opens the datetime picker. Set it to false if only opening the calendar programmatically with the [open()] method is needed.booleantrue
Close On Selectclose-on-selectWhether or not the calendar should close after date selection.booleantrue
ConjunctionconjunctionSeparates dates in the entry field, using Conjunction, as it is used in "multiple" mode.stringundefined
Date Formatdate-formatString of characters which are used to define how the date will be displayed in the input box.string"Y-m-d"
Date Parser--Custom datestring parser(date: string, format: string) => Dateundefined
Default Datedefault-dateSets the initial selected date(s). If using mode: "multiple" or a range calendar supply an Array of Date objects or an Array of date strings which follow the defualt dateFormat. Otherwise, supply a single Date object or a date string.Date | DateOption[] | number | stringundefined
Default Hourdefault-hourInitializes value of the hour element, when no date is selected.number12
Default Minutedefault-minuteInitializes the value of the minute element, when no date is selected.number0
Default Secondsdefault-secondsInitializes the value of the seconds element, when no date is selected.number0
Disable--Disables certain dates, preventing them from being selected.DateLimit<DateOption>[][]
Disable Mobiledisable-mobileSets this field to true in order to always use the non-native picker on mobile devices.booleanfalse
Enable--Disables all dates except the specified ones.DateLimit<DateOption>[][(_) => true]
Enable Secondsenable-secondsEnables seconds selection in the time picker.booleanfalse
Enable Timeenable-timeEnables the time picker.booleanfalse
Format Date--Allows using a custom date formatting function instead of the built-in handling for date formats using dateFormat, altFormat, etc.(date: Date, format: string, locale: Object) => stringundefined
Hour Incrementhour-incrementAdjusts the step for the hour input, including scrolling.number1
InlineinlineDisplays the calendar in an inline manner.booleanfalse
LocalelocaleThe locale, either as a string (e.g. "ar", "en") or as an object."ar" | "at" | "az" | "be" | "bg" | "bn" | "bs" | "ca" | "cat" | "ckb" | "cs" | "cy" | "da" | "de" | "default" | "en" | "eo" | "es" | "et" | "fa" | "fi" | "fo" | "fr" | "gr" | "he" | "hi" | "hr" | "hu" | "hy" | "id" | "is" | "it" | "ja" | "ka" | "ko" | "km" | "kz" | "lt" | "lv" | "mk" | "mn" | "ms" | "my" | "nl" | "nn" | "no" | "pa" | "pl" | "pt" | "ro" | "ru" | "si" | "sk" | "sl" | "sq" | "sr" | "sv" | "th" | "tr" | "uk" | "vn" | "zh" | "uz" | "uz_latn" | "zh_tw""en"
Maximum Datemax-dateThe maximum date that a user can pick to.Date | number | stringnull
Maximum Timemax-timeThe minimum date that a user can start picking from.Date | number | stringnull
Minimum Datemin-dateThe minimum date that a user can start picking from.Date | number | stringnull
Minimum Timemin-timeThe minimum time that a user can start picking from.Date | number | stringnull
Minute Incrementminute-incrementAdjusts the step for the minute input, including scrolling.number5
ModemodeDate selection mode."multiple" | "range" | "single" | "time""single"
Month Selector Typemonth-selector-typeHow the month should be displayed in the header of the calendar. If showMonths has a value greater than 1, the month is always shown as static."dropdown" | "static""dropdown"
NamenameInput name.stringundefiend
Next Arrownext-arrowHTML for the arrow icon, used to switch months.string'<span class="sicon-keyboard_arrow_right"></span>'
No Calendarno-calendarHides the day selection in calendar. Use it along with enableTime to create a time picker.booleanfalse
PlaceholderplaceholderPlaceholder text to show on the input element.stringsalla.lang.get('blocks.buy_as_gift.select_send_date_and_time')
PositionpositionHow the calendar should be positioned with regards to the input."above center" | "above left" | "above right" | "above" | "auto center" | "auto left" | "auto right" | "auto" | "below center" | "below left" | "below right" | "below" | ((self: any, customElement: HTMLElement) => void)"auto"
Position Element--The element off, of which the calendar will be positioned.HTMLElementundefined
Previous Arrowprev-arrowHTML for the left arrow icon, used to switch months.string'<span class="sicon-keyboard_arrow_left"></span>'
RequiredrequiredWhether or not the input is required.booleanfalse
Short Hand Current Monthshorthand-current-monthWhether or not to display the current month name in shorthand mode, e.g. "Sep" instead "September".booleanfalse
Show Monthsshow-monthsThe number of months to be shown at the same time when displaying the calendar.number1
StaticstaticPositions the calendar inside the wrapper and next to the input element.booleanfalse
Time 24 Hourstime_-2-4hrDisplays time picker in 24 hour mode without AM/PM selection when enabled.booleanfalse
ValuevalueTwo way data binding to retrieve the selected datetime value.stringnull
Week Numbersweek-numbersEnables display of week numbers in calendar.booleanfalse
WrapwrapVisit here for more detailsbooleanfalse

Events#

EventDescriptionType
invalidInputThis event will be fired when the input is invalid.CustomEvent<any>
pickedThis event will be fired when the file input gets changed by the user, which happens when selecting file(s).CustomEvent<any>
Modified at 2024-02-20 07:05:42
Previous
Contacts
Next
File Upload