MCPcopy Create free account
hub / github.com/UI5/webcomponents / secondaryCalendarTypeButtonText

Method secondaryCalendarTypeButtonText

packages/main/src/Calendar.ts:764–780  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

762 }
763
764 get secondaryCalendarTypeButtonText() {
765 if (!this.hasSecondaryCalendarType) {
766 return;
767 }
768
769 const localDate = UI5Date.getInstance(this._timestamp * 1000);
770 const secondYearFormat = DateFormat.getDateInstance({ format: "y", calendarType: this._secondaryCalendarType });
771 const dateInSecType = transformDateToSecondaryType(this._primaryCalendarType, this._secondaryCalendarType, this._timestamp);
772 const secondMonthInfo = convertMonthNumbersToMonthNames(dateInSecType.firstDate.getMonth(), dateInSecType.lastDate.getMonth(), this._secondaryCalendarType);
773 const secondYearText = secondYearFormat.format(localDate);
774
775 return {
776 yearButtonText: secondYearText,
777 monthButtonText: secondMonthInfo.text,
778 monthButtonInfo: secondMonthInfo.textInfo,
779 };
780 }
781
782 get _isCompactMode() {
783 return getEffectiveContentDensity(this) === "compact";

Callers

nothing calls this directly

Calls 5

getDateInstanceMethod · 0.80
getMonthMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected