MCPcopy
hub / github.com/formatjs/formatjs / getWeekInfo

Method getWeekInfo

packages/intl-locale/index.ts:767–793  ·  view source on GitHub ↗

* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getWeekInfo

()

Source from the content-addressed store, hash-verified

765 * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getWeekInfo
766 */
767 public getWeekInfo(): {
768 firstDay: string
769 weekend: {start: string; end: string}
770 minimalDays: number
771 } {
772 const info = Object.create(Object.prototype)
773 const internalSlots = getInternalSlots(this)
774 if (!HasOwnProperty(internalSlots, 'initializedLocale')) {
775 throw new TypeError('Error uninitialized locale')
776 }
777
778 const wi = weekInfoOfLocale(this)
779 const we = wi.weekend
780
781 createDataProperty(info, 'firstDay', wi.firstDay)
782
783 createDataProperty(info, 'weekend', we)
784
785 createDataProperty(info, 'minimalDays', wi.minimalDays)
786
787 const fw = internalSlots.firstDayOfWeek
788 if (fw !== undefined) {
789 info.firstDay = fw
790 }
791
792 return info
793 }
794
795 static relevantExtensionKeys: readonly [
796 'ca',

Callers 1

index.test.tsFile · 0.80

Calls 4

HasOwnPropertyFunction · 0.85
weekInfoOfLocaleFunction · 0.85
createDataPropertyFunction · 0.85
getInternalSlotsFunction · 0.70

Tested by

no test coverage detected