SDatetimePickerComponent
This CustomElement make use of related resource(s).This component specify a datetime picker. It make uses of (this package)[https://www.npmjs.com/package/date-format-parse] behind the scene to parse and format dates.
Preview
Simple input
Loading code example. Please wait...
With a calendar
Loading code example. Please wait...
With a backdrop
Loading code example. Please wait...
With a different format and a calendar
Loading code example. Please wait...
Just a button with disabled weekend
Loading code example. Please wait...
Disabled
Loading code example. Please wait...
RTL Support
Loading code example. Please wait...
Features
Import
Install
Events
-
s-datetime-picker.change
Dispatched when the datepicker change value
-
s-datetime-picker
Dispatched for every events of this component. Check the detail.eventType prop for event type
Interface
-
namecolorString
Specify the name that will be assigned to the injected input if you don't provide one yourself
-
valueString
Specify the initial value for your picker
-
updateInput["select","validate","reset","clear","close"]
- select
- validate
- reset
- clear
- close
Array<String>Specify when you want to updat the attached input. Can be "pointermove", "pointerup", "pointerdown", "input", "validate", "close"
-
formatYYYY-MM-DDString
Specify the format of the color you want as end in the input value. Can be "hex", "hexa", "rgb", "rgba", "hsl" or "hsla"
-
inlinefalseBoolean
Specify if you want to initalize the color picker inline or if you want it to be displayed only when the focus is in the input
-
calendarfalseBoolean
Specify if you want to display a calendar or not
-
i18n{"reset":"Reset","clear":"Clear","validate":"Validate","months":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}Object
Specify some translations for the color picker. You can translate the "reset", "clear" and "validate" buttons
-
placeholderSelect a colorString
Specify the placeholder that will be assigned to the injected input if you don't provide one yourself
-
floatSettings{}Object
Specify some float settings to pass to the "makeFloat" function of the sugar toolkit
-
copyIconClasss-icon s-icon--copyString
Specify the class you want to apply on the "i" that display the "copy" icon
-
copiedIconClasss-icon s-icon--copiedString
Specify the class you want to apply on the "i" that display the "copy" icon when the color has been copied
-
buttonIconClasss-icon s-icon--colorString
Specify the class you want to apply on the injected button icon
-
backdropClasss-backdropString
Specify the class to apply on the backdrop when the "backdrop" prop is true
-
disable[]Array<String>
Specify what you want to disable. It can be "weekend", "week" or "2022-12-19" (dates)
-
disabledfalseBoolean
Specify if the color picker is disabled
-
backdropfalseBoolean
Specify if you want the ".s-backdrop" element or not
-
actions["reset","validate"]
- clear
- reset
- validate
Array<String>Specify the actions buttons you want to display. Can be "clear", "reset" and "validate". If false, hide all button
-
hours[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]Array<Number>
Specify the hours you want in the time selector
-
minutes[0,5,10,15,20,25,30,25,40,45,50,55]Array<Number>
Specify the minutes you want in the time selector
-
fromYear1923Number
Specify the first year to allow selection from
-
toYear2123Number
Specify the last year to allow selection from