Skip to main content

Calendar

<gstock-calendar> | GstockCalendar

API

Properties

Name Description Reflects Type Default
defaultValue The default value of the form control. Primarily used for resetting the form control. string[] []
currentDate
show-current-date
Enable this option to highlight the current date. boolean false
disabled Indicate if the calendar is disabled. Reflects boolean false
form By default, form controls are associated with the nearest containing <form> element. This attribute allows you to place the form control outside of a form and associate it with the form that has this id. The form must be in the same document or shadow root for this to work. Reflects string ''
minYear
min-year
Minimum year that can be navigated. number | undefined -
maxYear
max-year
Maximum year that can be navigated. number | undefined -
minDate
min-date
Minimum date that can be selected. string | undefined -
maxDate
max-date
Maximum date that can be selected. string | undefined -
name The name of the autocomplete, submitted as a name/value pair with form data. string ''
required The calendar’s required attribute. Reflects boolean false
startDayWeek
start-day-week
Indicate the start day of the week (0 for Sunday - 6 for Saturday). number 1
title Title to display in the calendar. string ''
validityStyles
validity-styles
Specify whether validation styles are applied. false -
value The current value of the dates, submitted as a name/value pair with form data. The value attribute will be a space-delimited list of values based on the dates selected, and the value property will be an array. string[] []
year Year to display in the calendar (default is the current year). number -
validity Gets the validity state object - -
validationMessage Gets the validation message - -
updateComplete

A read-only promise that resolves when the component has finished updating.

Learn more about attributes and properties .

Events

Name React Event Description Event Detail
gstock-change-event onGstockChangeEvent Emitted when the control’s value changes. -
gstock-input-event onGstockInputEvent Emitted when the control receives input. -

Learn more about events .

Methods

Name Description
checkValidity( ) Checks for validity but does not show a validation message. Returns true when valid and false when invalid.
getForm( ) Gets the associated form, if one exists.
reportValidity( ) Checks for validity and shows the browser’s validation message if the control is invalid.
setCustomValidity(
message: string
)
Sets a custom validation message. Pass an empty string to restore validity.
goToPreviousYear( ) Go to the previous year.
goToNextYear( ) Go to the next year.

Learn more about methods .

CSS Parts

Name Description
base The component’s base wrapper.
previous The previous button.
next The next button.

Learn more about CSS parts .

Dependencies

This component automatically imports the following dependencies.