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

Method _safelyModifyTimestampBy

packages/main/src/CalendarPart.ts:91–94  ·  view source on GitHub ↗

* Modify a timestamp by a certain amount of days/months/years and enforce limits * @param amount * @param unit * @param preserveDate whether to preserve the day of the month (f.e. 15th of March + 1 month = 15th of April) * @protected

(amount: number, unit: string, preserveDate?: boolean)

Source from the content-addressed store, hash-verified

89 * @protected
90 */
91 _safelyModifyTimestampBy(amount: number, unit: string, preserveDate?: boolean) {
92 const newDate = modifyDateBy(this._calendarDate, amount, unit, preserveDate);
93 this._safelySetTimestamp(newDate.valueOf() / 1000);
94 }
95
96 _getTimestampFromDom(domNode: HTMLElement) {
97 const oMonthDomRef = domNode.getAttribute("data-sap-timestamp")!;

Callers 4

_modifyTimestampByMethod · 0.80
_modifyTimestampByMethod · 0.80
_modifyTimestampByMethod · 0.80
_modifyTimestampByMethod · 0.80

Calls 3

_safelySetTimestampMethod · 0.95
modifyDateByFunction · 0.85
valueOfMethod · 0.80

Tested by

no test coverage detected