o2g-node-sdk 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -6
- package/dist/o2g-node-sdk.js +173 -3732
- package/dist/o2g-node-sdk.js.map +1 -1
- package/dist/types/ErrorInfo.d.ts +88 -0
- package/dist/types/ErrorInfo.d.ts.map +1 -0
- package/dist/types/host.d.ts +18 -0
- package/dist/types/host.d.ts.map +1 -0
- package/dist/types/internal/access-mode.d.ts +2 -0
- package/dist/types/internal/access-mode.d.ts.map +1 -0
- package/dist/types/internal/events/chunk-eventing.d.ts +2 -0
- package/dist/types/internal/events/chunk-eventing.d.ts.map +1 -0
- package/dist/types/internal/events/event-dispatcher.d.ts +2 -0
- package/dist/types/internal/events/event-dispatcher.d.ts.map +1 -0
- package/dist/types/internal/events/event-packages.d.ts +2 -0
- package/dist/types/internal/events/event-packages.d.ts.map +1 -0
- package/dist/types/internal/o2g-application.d.ts +2 -0
- package/dist/types/internal/o2g-application.d.ts.map +1 -0
- package/dist/types/internal/rest/analytics-rest.d.ts +2 -0
- package/dist/types/internal/rest/analytics-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/authentication-rest.d.ts +2 -0
- package/dist/types/internal/rest/authentication-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/ccAgent-rest.d.ts +2 -0
- package/dist/types/internal/rest/ccAgent-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/ccMngt-rest.d.ts +2 -0
- package/dist/types/internal/rest/ccMngt-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/ccPilot-rest.d.ts +2 -0
- package/dist/types/internal/rest/ccPilot-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/ccRealtime-rest.d.ts +2 -0
- package/dist/types/internal/rest/ccRealtime-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/ccStatistics-rest.d.ts +45 -0
- package/dist/types/internal/rest/ccStatistics-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/comlog-rest.d.ts +2 -0
- package/dist/types/internal/rest/comlog-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/directory-rest.d.ts +2 -0
- package/dist/types/internal/rest/directory-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/eventSummary-rest.d.ts +2 -0
- package/dist/types/internal/rest/eventSummary-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/maint-rest.d.ts +2 -0
- package/dist/types/internal/rest/maint-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/messaging-rest.d.ts +2 -0
- package/dist/types/internal/rest/messaging-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/o2g-rest.d.ts +2 -0
- package/dist/types/internal/rest/o2g-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/pbx-mngt-rest.d.ts +2 -0
- package/dist/types/internal/rest/pbx-mngt-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/phone-set-prog-rest.d.ts +2 -0
- package/dist/types/internal/rest/phone-set-prog-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/rest-service.d.ts +2 -0
- package/dist/types/internal/rest/rest-service.d.ts.map +1 -0
- package/dist/types/internal/rest/routing-rest.d.ts +2 -0
- package/dist/types/internal/rest/routing-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/rsi-rest.d.ts +2 -0
- package/dist/types/internal/rest/rsi-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/sessions-rest.d.ts +2 -0
- package/dist/types/internal/rest/sessions-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/subscriptions-rest.d.ts +2 -0
- package/dist/types/internal/rest/subscriptions-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/telephony-rest.d.ts +2 -0
- package/dist/types/internal/rest/telephony-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/users-mngt-rest.d.ts +2 -0
- package/dist/types/internal/rest/users-mngt-rest.d.ts.map +1 -0
- package/dist/types/internal/rest/users-rest.d.ts +2 -0
- package/dist/types/internal/rest/users-rest.d.ts.map +1 -0
- package/dist/types/internal/service-end-point.d.ts +2 -0
- package/dist/types/internal/service-end-point.d.ts.map +1 -0
- package/dist/types/internal/service-factory.d.ts +2 -0
- package/dist/types/internal/service-factory.d.ts.map +1 -0
- package/dist/types/internal/session.d.ts +2 -0
- package/dist/types/internal/session.d.ts.map +1 -0
- package/dist/types/internal/types/analytics/analytics-types.d.ts +2 -0
- package/dist/types/internal/types/analytics/analytics-types.d.ts.map +1 -0
- package/dist/types/internal/types/cc-agent/cc-agent-types.d.ts +2 -0
- package/dist/types/internal/types/cc-agent/cc-agent-types.d.ts.map +1 -0
- package/dist/types/internal/types/cc-mngt/cc-mntg-types.d.ts +2 -0
- package/dist/types/internal/types/cc-mngt/cc-mntg-types.d.ts.map +1 -0
- package/dist/types/internal/types/cc-pilot/cc-pilot-types.d.ts +2 -0
- package/dist/types/internal/types/cc-pilot/cc-pilot-types.d.ts.map +1 -0
- package/dist/types/internal/types/cc-rt/cc-rt-types.d.ts +2 -0
- package/dist/types/internal/types/cc-rt/cc-rt-types.d.ts.map +1 -0
- package/dist/types/internal/types/cc-stat/abstract-filter.d.ts +2 -0
- package/dist/types/internal/types/cc-stat/abstract-filter.d.ts.map +1 -0
- package/dist/types/internal/types/cc-stat/ag-filter-impl.d.ts +2 -0
- package/dist/types/internal/types/cc-stat/ag-filter-impl.d.ts.map +1 -0
- package/dist/types/internal/types/cc-stat/cc-stat-types.d.ts +56 -0
- package/dist/types/internal/types/cc-stat/cc-stat-types.d.ts.map +1 -0
- package/dist/types/internal/types/cc-stat/context-impl.d.ts +2 -0
- package/dist/types/internal/types/cc-stat/context-impl.d.ts.map +1 -0
- package/dist/types/internal/types/cc-stat/on-stats-progress.d.ts +2 -0
- package/dist/types/internal/types/cc-stat/on-stats-progress.d.ts.map +1 -0
- package/dist/types/internal/types/cc-stat/pil-filter-impl.d.ts +2 -0
- package/dist/types/internal/types/cc-stat/pil-filter-impl.d.ts.map +1 -0
- package/dist/types/internal/types/cc-stat/requester-impl.d.ts +2 -0
- package/dist/types/internal/types/cc-stat/requester-impl.d.ts.map +1 -0
- package/dist/types/internal/types/cc-stat/scheduled-rep-impl.d.ts +2 -0
- package/dist/types/internal/types/cc-stat/scheduled-rep-impl.d.ts.map +1 -0
- package/dist/types/internal/types/comlog/comlog-types.d.ts +2 -0
- package/dist/types/internal/types/comlog/comlog-types.d.ts.map +1 -0
- package/dist/types/internal/types/common/common-types.d.ts +2 -0
- package/dist/types/internal/types/common/common-types.d.ts.map +1 -0
- package/dist/types/internal/types/directory/directory-types.d.ts +2 -0
- package/dist/types/internal/types/directory/directory-types.d.ts.map +1 -0
- package/dist/types/internal/types/eventsummary/eventsummary-types.d.ts +14 -0
- package/dist/types/internal/types/eventsummary/eventsummary-types.d.ts.map +1 -0
- package/dist/types/internal/types/maint/maint-types.d.ts +2 -0
- package/dist/types/internal/types/maint/maint-types.d.ts.map +1 -0
- package/dist/types/internal/types/messaging/messaging-types.d.ts +2 -0
- package/dist/types/internal/types/messaging/messaging-types.d.ts.map +1 -0
- package/dist/types/internal/types/pbxmngt/pbxmngt-types.d.ts +2 -0
- package/dist/types/internal/types/pbxmngt/pbxmngt-types.d.ts.map +1 -0
- package/dist/types/internal/types/phoneset/phoneset-types.d.ts +2 -0
- package/dist/types/internal/types/phoneset/phoneset-types.d.ts.map +1 -0
- package/dist/types/internal/types/routing/routing-types.d.ts +2 -0
- package/dist/types/internal/types/routing/routing-types.d.ts.map +1 -0
- package/dist/types/internal/types/rsi/rsi-types.d.ts +2 -0
- package/dist/types/internal/types/rsi/rsi-types.d.ts.map +1 -0
- package/dist/types/internal/types/telephony/telephony-types.d.ts +2 -0
- package/dist/types/internal/types/telephony/telephony-types.d.ts.map +1 -0
- package/dist/types/internal/types/users/users-types.d.ts +2 -0
- package/dist/types/internal/types/users/users-types.d.ts.map +1 -0
- package/dist/types/internal/util/IHttpClient.d.ts +2 -0
- package/dist/types/internal/util/IHttpClient.d.ts.map +1 -0
- package/dist/types/internal/util/assert.d.ts +2 -0
- package/dist/types/internal/util/assert.d.ts.map +1 -0
- package/dist/types/internal/util/file-utils.d.ts +2 -0
- package/dist/types/internal/util/file-utils.d.ts.map +1 -0
- package/dist/types/internal/util/format-util.d.ts +2 -0
- package/dist/types/internal/util/format-util.d.ts.map +1 -0
- package/dist/types/internal/util/hexa-string.d.ts +2 -0
- package/dist/types/internal/util/hexa-string.d.ts.map +1 -0
- package/dist/types/internal/util/http-client.d.ts +2 -0
- package/dist/types/internal/util/http-client.d.ts.map +1 -0
- package/dist/types/internal/util/http-content.d.ts +2 -0
- package/dist/types/internal/util/http-content.d.ts.map +1 -0
- package/dist/types/internal/util/http-response.d.ts +2 -0
- package/dist/types/internal/util/http-response.d.ts.map +1 -0
- package/dist/types/internal/util/injection-container.d.ts +5 -0
- package/dist/types/internal/util/injection-container.d.ts.map +1 -0
- package/dist/types/internal/util/logger.d.ts +7 -0
- package/dist/types/internal/util/logger.d.ts.map +1 -0
- package/dist/types/internal/util/util-uri.d.ts +2 -0
- package/dist/types/internal/util/util-uri.d.ts.map +1 -0
- package/dist/types/o2g-analytics.d.ts +61 -0
- package/dist/types/o2g-analytics.d.ts.map +1 -0
- package/dist/types/o2g-cc-agent.d.ts +376 -0
- package/dist/types/o2g-cc-agent.d.ts.map +1 -0
- package/dist/types/o2g-cc-mngt.d.ts +213 -0
- package/dist/types/o2g-cc-mngt.d.ts.map +1 -0
- package/dist/types/o2g-cc-pilot.d.ts +71 -0
- package/dist/types/o2g-cc-pilot.d.ts.map +1 -0
- package/dist/types/o2g-cc-rt.d.ts +163 -0
- package/dist/types/o2g-cc-rt.d.ts.map +1 -0
- package/dist/types/o2g-cc-stat.d.ts +450 -0
- package/dist/types/o2g-cc-stat.d.ts.map +1 -0
- package/dist/types/o2g-comlog.d.ts +245 -0
- package/dist/types/o2g-comlog.d.ts.map +1 -0
- package/dist/types/o2g-directory.d.ts +109 -0
- package/dist/types/o2g-directory.d.ts.map +1 -0
- package/dist/types/o2g-eventSummary.d.ts +44 -0
- package/dist/types/o2g-eventSummary.d.ts.map +1 -0
- package/dist/types/o2g-maint.d.ts +82 -0
- package/dist/types/o2g-maint.d.ts.map +1 -0
- package/dist/types/o2g-messaging.d.ts +137 -0
- package/dist/types/o2g-messaging.d.ts.map +1 -0
- package/dist/types/o2g-node-sdk.d.ts +421 -0
- package/dist/types/o2g-node-sdk.d.ts.map +1 -0
- package/dist/types/o2g-pbx-mngt.d.ts +244 -0
- package/dist/types/o2g-pbx-mngt.d.ts.map +1 -0
- package/dist/types/o2g-phone-set-prog.d.ts +269 -0
- package/dist/types/o2g-phone-set-prog.d.ts.map +1 -0
- package/dist/types/o2g-routing.d.ts +313 -0
- package/dist/types/o2g-routing.d.ts.map +1 -0
- package/dist/types/o2g-rsi.d.ts +155 -0
- package/dist/types/o2g-rsi.d.ts.map +1 -0
- package/dist/types/o2g-telephony.d.ts +895 -0
- package/dist/types/o2g-telephony.d.ts.map +1 -0
- package/dist/types/o2g-users-mngt.d.ts +83 -0
- package/dist/types/o2g-users-mngt.d.ts.map +1 -0
- package/dist/types/o2g-users.d.ts +127 -0
- package/dist/types/o2g-users.d.ts.map +1 -0
- package/dist/types/subscription.d.ts +379 -0
- package/dist/types/subscription.d.ts.map +1 -0
- package/dist/types/supervised-account.d.ts +40 -0
- package/dist/types/supervised-account.d.ts.map +1 -0
- package/dist/types/types/analytics/call-type.d.ts +25 -0
- package/dist/types/types/analytics/call-type.d.ts.map +1 -0
- package/dist/types/types/analytics/charging-file.d.ts +13 -0
- package/dist/types/types/analytics/charging-file.d.ts.map +1 -0
- package/dist/types/types/analytics/charging-result.d.ts +50 -0
- package/dist/types/types/analytics/charging-result.d.ts.map +1 -0
- package/dist/types/types/analytics/charging.d.ts +69 -0
- package/dist/types/types/analytics/charging.d.ts.map +1 -0
- package/dist/types/types/analytics/incident.d.ts +41 -0
- package/dist/types/types/analytics/incident.d.ts.map +1 -0
- package/dist/types/types/analytics/tel-facility.d.ts +45 -0
- package/dist/types/types/analytics/tel-facility.d.ts.map +1 -0
- package/dist/types/types/cc-agent/agent-groups.d.ts +11 -0
- package/dist/types/types/cc-agent/agent-groups.d.ts.map +1 -0
- package/dist/types/types/cc-agent/agent-skill-set.d.ts +43 -0
- package/dist/types/types/cc-agent/agent-skill-set.d.ts.map +1 -0
- package/dist/types/types/cc-agent/agent-skill.d.ts +15 -0
- package/dist/types/types/cc-agent/agent-skill.d.ts.map +1 -0
- package/dist/types/types/cc-agent/cc-agent-events.d.ts +44 -0
- package/dist/types/types/cc-agent/cc-agent-events.d.ts.map +1 -0
- package/dist/types/types/cc-agent/intrusion-mode.d.ts +25 -0
- package/dist/types/types/cc-agent/intrusion-mode.d.ts.map +1 -0
- package/dist/types/types/cc-agent/operator-config.d.ts +76 -0
- package/dist/types/types/cc-agent/operator-config.d.ts.map +1 -0
- package/dist/types/types/cc-agent/operator-state.d.ts +100 -0
- package/dist/types/types/cc-agent/operator-state.d.ts.map +1 -0
- package/dist/types/types/cc-agent/operator-type.d.ts +17 -0
- package/dist/types/types/cc-agent/operator-type.d.ts.map +1 -0
- package/dist/types/types/cc-agent/withdraw-reason.d.ts +23 -0
- package/dist/types/types/cc-agent/withdraw-reason.d.ts.map +1 -0
- package/dist/types/types/cc-mngt/calendar/abstract-calendar.d.ts +8 -0
- package/dist/types/types/cc-mngt/calendar/abstract-calendar.d.ts.map +1 -0
- package/dist/types/types/cc-mngt/calendar/calendar.d.ts +22 -0
- package/dist/types/types/cc-mngt/calendar/calendar.d.ts.map +1 -0
- package/dist/types/types/cc-mngt/calendar/exception-calendar.d.ts +31 -0
- package/dist/types/types/cc-mngt/calendar/exception-calendar.d.ts.map +1 -0
- package/dist/types/types/cc-mngt/calendar/normal-calendar.d.ts +31 -0
- package/dist/types/types/cc-mngt/calendar/normal-calendar.d.ts.map +1 -0
- package/dist/types/types/cc-mngt/calendar/pilot-operating-Mode.d.ts +18 -0
- package/dist/types/types/cc-mngt/calendar/pilot-operating-Mode.d.ts.map +1 -0
- package/dist/types/types/cc-mngt/calendar/transition.d.ts +65 -0
- package/dist/types/types/cc-mngt/calendar/transition.d.ts.map +1 -0
- package/dist/types/types/cc-mngt/pilot-rule-set.d.ts +33 -0
- package/dist/types/types/cc-mngt/pilot-rule-set.d.ts.map +1 -0
- package/dist/types/types/cc-mngt/pilot-rule.d.ts +24 -0
- package/dist/types/types/cc-mngt/pilot-rule.d.ts.map +1 -0
- package/dist/types/types/cc-mngt/pilot.d.ts +58 -0
- package/dist/types/types/cc-mngt/pilot.d.ts.map +1 -0
- package/dist/types/types/cc-pilot/call-data-pilot.d.ts +50 -0
- package/dist/types/types/cc-pilot/call-data-pilot.d.ts.map +1 -0
- package/dist/types/types/cc-pilot/cc-pilot-events.d.ts +131 -0
- package/dist/types/types/cc-pilot/cc-pilot-events.d.ts.map +1 -0
- package/dist/types/types/cc-rt/agent-attributes.d.ts +50 -0
- package/dist/types/types/cc-rt/agent-attributes.d.ts.map +1 -0
- package/dist/types/types/cc-rt/agent-pg-attributes.d.ts +50 -0
- package/dist/types/types/cc-rt/agent-pg-attributes.d.ts.map +1 -0
- package/dist/types/types/cc-rt/agent-pg-type.d.ts +17 -0
- package/dist/types/types/cc-rt/agent-pg-type.d.ts.map +1 -0
- package/dist/types/types/cc-rt/agent-phone-state.d.ts +67 -0
- package/dist/types/types/cc-rt/agent-phone-state.d.ts.map +1 -0
- package/dist/types/types/cc-rt/agent-service-type.d.ts +16 -0
- package/dist/types/types/cc-rt/agent-service-type.d.ts.map +1 -0
- package/dist/types/types/cc-rt/agent-type.d.ts +16 -0
- package/dist/types/types/cc-rt/agent-type.d.ts.map +1 -0
- package/dist/types/types/cc-rt/cc-rt-events.d.ts +274 -0
- package/dist/types/types/cc-rt/cc-rt-events.d.ts.map +1 -0
- package/dist/types/types/cc-rt/other-pg-attributes.d.ts +18 -0
- package/dist/types/types/cc-rt/other-pg-attributes.d.ts.map +1 -0
- package/dist/types/types/cc-rt/other-pg-type.d.ts +22 -0
- package/dist/types/types/cc-rt/other-pg-type.d.ts.map +1 -0
- package/dist/types/types/cc-rt/pilot-attributes.d.ts +40 -0
- package/dist/types/types/cc-rt/pilot-attributes.d.ts.map +1 -0
- package/dist/types/types/cc-rt/queue-attributes.d.ts +30 -0
- package/dist/types/types/cc-rt/queue-attributes.d.ts.map +1 -0
- package/dist/types/types/cc-rt/queue-type.d.ts +23 -0
- package/dist/types/types/cc-rt/queue-type.d.ts.map +1 -0
- package/dist/types/types/cc-rt/rti-context.d.ts +56 -0
- package/dist/types/types/cc-rt/rti-context.d.ts.map +1 -0
- package/dist/types/types/cc-rt/rti-filter.d.ts +117 -0
- package/dist/types/types/cc-rt/rti-filter.d.ts.map +1 -0
- package/dist/types/types/cc-rt/rti-object-identifier.d.ts +34 -0
- package/dist/types/types/cc-rt/rti-object-identifier.d.ts.map +1 -0
- package/dist/types/types/cc-rt/rti-objects.d.ts +72 -0
- package/dist/types/types/cc-rt/rti-objects.d.ts.map +1 -0
- package/dist/types/types/cc-stats/agbypilot-attributes.d.ts +73 -0
- package/dist/types/types/cc-stats/agbypilot-attributes.d.ts.map +1 -0
- package/dist/types/types/cc-stats/agent-attributes.d.ts +377 -0
- package/dist/types/types/cc-stats/agent-attributes.d.ts.map +1 -0
- package/dist/types/types/cc-stats/agent-filter.d.ts +60 -0
- package/dist/types/types/cc-stats/agent-filter.d.ts.map +1 -0
- package/dist/types/types/cc-stats/data/ag-by-pil-stats-row.d.ts +184 -0
- package/dist/types/types/cc-stats/data/ag-by-pil-stats-row.d.ts.map +1 -0
- package/dist/types/types/cc-stats/data/ag-stats-row.d.ts +608 -0
- package/dist/types/types/cc-stats/data/ag-stats-row.d.ts.map +1 -0
- package/dist/types/types/cc-stats/data/data-obs-period.d.ts +20 -0
- package/dist/types/types/cc-stats/data/data-obs-period.d.ts.map +1 -0
- package/dist/types/types/cc-stats/data/pil-stats-row.d.ts +623 -0
- package/dist/types/types/cc-stats/data/pil-stats-row.d.ts.map +1 -0
- package/dist/types/types/cc-stats/data/selected-period.d.ts +49 -0
- package/dist/types/types/cc-stats/data/selected-period.d.ts.map +1 -0
- package/dist/types/types/cc-stats/data/stat-value.d.ts +36 -0
- package/dist/types/types/cc-stats/data/stat-value.d.ts.map +1 -0
- package/dist/types/types/cc-stats/data/stats-data.d.ts +64 -0
- package/dist/types/types/cc-stats/data/stats-data.d.ts.map +1 -0
- package/dist/types/types/cc-stats/events/progress-callback.d.ts +9 -0
- package/dist/types/types/cc-stats/events/progress-callback.d.ts.map +1 -0
- package/dist/types/types/cc-stats/events/progress-step.d.ts +20 -0
- package/dist/types/types/cc-stats/events/progress-step.d.ts.map +1 -0
- package/dist/types/types/cc-stats/language.d.ts +15 -0
- package/dist/types/types/cc-stats/language.d.ts.map +1 -0
- package/dist/types/types/cc-stats/pilot-attributes.d.ts +185 -0
- package/dist/types/types/cc-stats/pilot-attributes.d.ts.map +1 -0
- package/dist/types/types/cc-stats/pilot-filter.d.ts +45 -0
- package/dist/types/types/cc-stats/pilot-filter.d.ts.map +1 -0
- package/dist/types/types/cc-stats/requester.d.ts +33 -0
- package/dist/types/types/cc-stats/requester.d.ts.map +1 -0
- package/dist/types/types/cc-stats/scheduled/recurrence.d.ts +69 -0
- package/dist/types/types/cc-stats/scheduled/recurrence.d.ts.map +1 -0
- package/dist/types/types/cc-stats/scheduled/report-obs-period.d.ts +87 -0
- package/dist/types/types/cc-stats/scheduled/report-obs-period.d.ts.map +1 -0
- package/dist/types/types/cc-stats/scheduled/scheduled-report.d.ts +132 -0
- package/dist/types/types/cc-stats/scheduled/scheduled-report.d.ts.map +1 -0
- package/dist/types/types/cc-stats/stats-context.d.ts +66 -0
- package/dist/types/types/cc-stats/stats-context.d.ts.map +1 -0
- package/dist/types/types/cc-stats/stats-filter.d.ts +34 -0
- package/dist/types/types/cc-stats/stats-filter.d.ts.map +1 -0
- package/dist/types/types/cc-stats/stats-format.d.ts +17 -0
- package/dist/types/types/cc-stats/stats-format.d.ts.map +1 -0
- package/dist/types/types/cc-stats/time-interval.d.ts +19 -0
- package/dist/types/types/cc-stats/time-interval.d.ts.map +1 -0
- package/dist/types/types/comlog/com-record-participant.d.ts +75 -0
- package/dist/types/types/comlog/com-record-participant.d.ts.map +1 -0
- package/dist/types/types/comlog/com-record.d.ts +97 -0
- package/dist/types/types/comlog/com-record.d.ts.map +1 -0
- package/dist/types/types/comlog/comlog-events.d.ts +110 -0
- package/dist/types/types/comlog/comlog-events.d.ts.map +1 -0
- package/dist/types/types/comlog/filter-option.d.ts +24 -0
- package/dist/types/types/comlog/filter-option.d.ts.map +1 -0
- package/dist/types/types/comlog/page.d.ts +34 -0
- package/dist/types/types/comlog/page.d.ts.map +1 -0
- package/dist/types/types/comlog/query-filter.d.ts +79 -0
- package/dist/types/types/comlog/query-filter.d.ts.map +1 -0
- package/dist/types/types/comlog/query-result.d.ts +55 -0
- package/dist/types/types/comlog/query-result.d.ts.map +1 -0
- package/dist/types/types/comlog/reason.d.ts +62 -0
- package/dist/types/types/comlog/reason.d.ts.map +1 -0
- package/dist/types/types/comlog/role.d.ts +18 -0
- package/dist/types/types/comlog/role.d.ts.map +1 -0
- package/dist/types/types/common/date-range.d.ts +17 -0
- package/dist/types/types/common/date-range.d.ts.map +1 -0
- package/dist/types/types/common/day-of-week.d.ts +15 -0
- package/dist/types/types/common/day-of-week.d.ts.map +1 -0
- package/dist/types/types/common/device-type.d.ts +22 -0
- package/dist/types/types/common/device-type.d.ts.map +1 -0
- package/dist/types/types/common/device.d.ts +75 -0
- package/dist/types/types/common/device.d.ts.map +1 -0
- package/dist/types/types/common/identifier.d.ts +20 -0
- package/dist/types/types/common/identifier.d.ts.map +1 -0
- package/dist/types/types/common/main-type.d.ts +26 -0
- package/dist/types/types/common/main-type.d.ts.map +1 -0
- package/dist/types/types/common/party-info-type.d.ts +22 -0
- package/dist/types/types/common/party-info-type.d.ts.map +1 -0
- package/dist/types/types/common/party-info.d.ts +28 -0
- package/dist/types/types/common/party-info.d.ts.map +1 -0
- package/dist/types/types/common/service-state.d.ts +20 -0
- package/dist/types/types/common/service-state.d.ts.map +1 -0
- package/dist/types/types/directory/criteria.d.ts +95 -0
- package/dist/types/types/directory/criteria.d.ts.map +1 -0
- package/dist/types/types/directory/filter-item.d.ts +22 -0
- package/dist/types/types/directory/filter-item.d.ts.map +1 -0
- package/dist/types/types/directory/logical-operation.d.ts +14 -0
- package/dist/types/types/directory/logical-operation.d.ts.map +1 -0
- package/dist/types/types/directory/operation-filter.d.ts +22 -0
- package/dist/types/types/directory/operation-filter.d.ts.map +1 -0
- package/dist/types/types/directory/result-item.d.ts +22 -0
- package/dist/types/types/directory/result-item.d.ts.map +1 -0
- package/dist/types/types/directory/search-result.d.ts +64 -0
- package/dist/types/types/directory/search-result.d.ts.map +1 -0
- package/dist/types/types/events/events.d.ts +77 -0
- package/dist/types/types/events/events.d.ts.map +1 -0
- package/dist/types/types/eventsummary/event-summary-counter.d.ts +69 -0
- package/dist/types/types/eventsummary/event-summary-counter.d.ts.map +1 -0
- package/dist/types/types/eventsummary/event-summary-events.d.ts +26 -0
- package/dist/types/types/eventsummary/event-summary-events.d.ts.map +1 -0
- package/dist/types/types/maint/configuration-type.d.ts +15 -0
- package/dist/types/types/maint/configuration-type.d.ts.map +1 -0
- package/dist/types/types/maint/cti-link-state.d.ts +19 -0
- package/dist/types/types/maint/cti-link-state.d.ts.map +1 -0
- package/dist/types/types/maint/license-status.d.ts +42 -0
- package/dist/types/types/maint/license-status.d.ts.map +1 -0
- package/dist/types/types/maint/license-type.d.ts +19 -0
- package/dist/types/types/maint/license-type.d.ts.map +1 -0
- package/dist/types/types/maint/license.d.ts +38 -0
- package/dist/types/types/maint/license.d.ts.map +1 -0
- package/dist/types/types/maint/maint-events.d.ts +105 -0
- package/dist/types/types/maint/maint-events.d.ts.map +1 -0
- package/dist/types/types/maint/pbx-status.d.ts +77 -0
- package/dist/types/types/maint/pbx-status.d.ts.map +1 -0
- package/dist/types/types/maint/server-address.d.ts +25 -0
- package/dist/types/types/maint/server-address.d.ts.map +1 -0
- package/dist/types/types/maint/service-status.d.ts +31 -0
- package/dist/types/types/maint/service-status.d.ts.map +1 -0
- package/dist/types/types/maint/subscriber-filter.d.ts +24 -0
- package/dist/types/types/maint/subscriber-filter.d.ts.map +1 -0
- package/dist/types/types/maint/sys-service-status.d.ts +33 -0
- package/dist/types/types/maint/sys-service-status.d.ts.map +1 -0
- package/dist/types/types/maint/sys-status.d.ts +79 -0
- package/dist/types/types/maint/sys-status.d.ts.map +1 -0
- package/dist/types/types/messaging/mailbox-info.d.ts +35 -0
- package/dist/types/types/messaging/mailbox-info.d.ts.map +1 -0
- package/dist/types/types/messaging/mailbox.d.ts +119 -0
- package/dist/types/types/messaging/mailbox.d.ts.map +1 -0
- package/dist/types/types/messaging/voice-message.d.ts +57 -0
- package/dist/types/types/messaging/voice-message.d.ts.map +1 -0
- package/dist/types/types/pbxmngt/attribute-filter.d.ts +31 -0
- package/dist/types/types/pbxmngt/attribute-filter.d.ts.map +1 -0
- package/dist/types/types/pbxmngt/instance-filter.d.ts +72 -0
- package/dist/types/types/pbxmngt/instance-filter.d.ts.map +1 -0
- package/dist/types/types/pbxmngt/model.d.ts +221 -0
- package/dist/types/types/pbxmngt/model.d.ts.map +1 -0
- package/dist/types/types/pbxmngt/octet-string-length.d.ts +12 -0
- package/dist/types/types/pbxmngt/octet-string-length.d.ts.map +1 -0
- package/dist/types/types/pbxmngt/pbx-attr-map.d.ts +96 -0
- package/dist/types/types/pbxmngt/pbx-attr-map.d.ts.map +1 -0
- package/dist/types/types/pbxmngt/pbx-attribute.d.ts +182 -0
- package/dist/types/types/pbxmngt/pbx-attribute.d.ts.map +1 -0
- package/dist/types/types/pbxmngt/pbx-object.d.ts +73 -0
- package/dist/types/types/pbxmngt/pbx-object.d.ts.map +1 -0
- package/dist/types/types/pbxmngt/pbx.d.ts +23 -0
- package/dist/types/types/pbxmngt/pbx.d.ts.map +1 -0
- package/dist/types/types/pbxmngt/pbxmngt-events.d.ts +74 -0
- package/dist/types/types/pbxmngt/pbxmngt-events.d.ts.map +1 -0
- package/dist/types/types/phoneset/device-key.d.ts +36 -0
- package/dist/types/types/phoneset/device-key.d.ts.map +1 -0
- package/dist/types/types/phoneset/dynamic-state.d.ts +30 -0
- package/dist/types/types/phoneset/dynamic-state.d.ts.map +1 -0
- package/dist/types/types/phoneset/pin.d.ts +53 -0
- package/dist/types/types/phoneset/pin.d.ts.map +1 -0
- package/dist/types/types/phoneset/prog-key.d.ts +26 -0
- package/dist/types/types/phoneset/prog-key.d.ts.map +1 -0
- package/dist/types/types/phoneset/soft-key.d.ts +18 -0
- package/dist/types/types/phoneset/soft-key.d.ts.map +1 -0
- package/dist/types/types/routing/destination.d.ts +18 -0
- package/dist/types/types/routing/destination.d.ts.map +1 -0
- package/dist/types/types/routing/dnd-state.d.ts +9 -0
- package/dist/types/types/routing/dnd-state.d.ts.map +1 -0
- package/dist/types/types/routing/forward-condition.d.ts +26 -0
- package/dist/types/types/routing/forward-condition.d.ts.map +1 -0
- package/dist/types/types/routing/forward.d.ts +53 -0
- package/dist/types/types/routing/forward.d.ts.map +1 -0
- package/dist/types/types/routing/overflow-condition.d.ts +22 -0
- package/dist/types/types/routing/overflow-condition.d.ts.map +1 -0
- package/dist/types/types/routing/overflow.d.ts +50 -0
- package/dist/types/types/routing/overflow.d.ts.map +1 -0
- package/dist/types/types/routing/routing-capabilities.d.ts +15 -0
- package/dist/types/types/routing/routing-capabilities.d.ts.map +1 -0
- package/dist/types/types/routing/routing-events.d.ts +23 -0
- package/dist/types/types/routing/routing-events.d.ts.map +1 -0
- package/dist/types/types/routing/routing-state.d.ts +52 -0
- package/dist/types/types/routing/routing-state.d.ts.map +1 -0
- package/dist/types/types/rsi/add-digit-coll-criteria.d.ts +17 -0
- package/dist/types/types/rsi/add-digit-coll-criteria.d.ts.map +1 -0
- package/dist/types/types/rsi/collection-cause.d.ts +22 -0
- package/dist/types/types/rsi/collection-cause.d.ts.map +1 -0
- package/dist/types/types/rsi/route-session.d.ts +21 -0
- package/dist/types/types/rsi/route-session.d.ts.map +1 -0
- package/dist/types/types/rsi/routing-caller-type.d.ts +18 -0
- package/dist/types/types/rsi/routing-caller-type.d.ts.map +1 -0
- package/dist/types/types/rsi/routing-reason.d.ts +26 -0
- package/dist/types/types/rsi/routing-reason.d.ts.map +1 -0
- package/dist/types/types/rsi/rsi-events.d.ts +47 -0
- package/dist/types/types/rsi/rsi-events.d.ts.map +1 -0
- package/dist/types/types/rsi/rsi-point.d.ts +17 -0
- package/dist/types/types/rsi/rsi-point.d.ts.map +1 -0
- package/dist/types/types/rsi/tones.d.ts +26 -0
- package/dist/types/types/rsi/tones.d.ts.map +1 -0
- package/dist/types/types/telephony/RecordingAction.d.ts +7 -0
- package/dist/types/types/telephony/RecordingAction.d.ts.map +1 -0
- package/dist/types/types/telephony/call/call-cause.d.ts +123 -0
- package/dist/types/types/telephony/call/call-cause.d.ts.map +1 -0
- package/dist/types/types/telephony/call/call-data.d.ts +81 -0
- package/dist/types/types/telephony/call/call-data.d.ts.map +1 -0
- package/dist/types/types/telephony/call/ccd/acd-call-info.d.ts +35 -0
- package/dist/types/types/telephony/call/ccd/acd-call-info.d.ts.map +1 -0
- package/dist/types/types/telephony/call/ccd/acd-data.d.ts +50 -0
- package/dist/types/types/telephony/call/ccd/acd-data.d.ts.map +1 -0
- package/dist/types/types/telephony/call/ccd/call-profile.d.ts +112 -0
- package/dist/types/types/telephony/call/ccd/call-profile.d.ts.map +1 -0
- package/dist/types/types/telephony/call/ccd/pilot-info.d.ts +43 -0
- package/dist/types/types/telephony/call/ccd/pilot-info.d.ts.map +1 -0
- package/dist/types/types/telephony/call/ccd/pilot-status.d.ts +38 -0
- package/dist/types/types/telephony/call/ccd/pilot-status.d.ts.map +1 -0
- package/dist/types/types/telephony/call/ccd/pilot-transfer-info.d.ts +24 -0
- package/dist/types/types/telephony/call/ccd/pilot-transfer-info.d.ts.map +1 -0
- package/dist/types/types/telephony/call/ccd/pilot-transfer-query-param.d.ts +104 -0
- package/dist/types/types/telephony/call/ccd/pilot-transfer-query-param.d.ts.map +1 -0
- package/dist/types/types/telephony/call/ccd/queue-data.d.ts +23 -0
- package/dist/types/types/telephony/call/ccd/queue-data.d.ts.map +1 -0
- package/dist/types/types/telephony/call/correlator-data.d.ts +54 -0
- package/dist/types/types/telephony/call/correlator-data.d.ts.map +1 -0
- package/dist/types/types/telephony/call/leg.d.ts +57 -0
- package/dist/types/types/telephony/call/leg.d.ts.map +1 -0
- package/dist/types/types/telephony/call/media-state.d.ts +42 -0
- package/dist/types/types/telephony/call/media-state.d.ts.map +1 -0
- package/dist/types/types/telephony/call/participant.d.ts +34 -0
- package/dist/types/types/telephony/call/participant.d.ts.map +1 -0
- package/dist/types/types/telephony/call/record-state.d.ts +14 -0
- package/dist/types/types/telephony/call/record-state.d.ts.map +1 -0
- package/dist/types/types/telephony/call/tag.d.ts +37 -0
- package/dist/types/types/telephony/call/tag.d.ts.map +1 -0
- package/dist/types/types/telephony/call.d.ts +90 -0
- package/dist/types/types/telephony/call.d.ts.map +1 -0
- package/dist/types/types/telephony/callback.d.ts +33 -0
- package/dist/types/types/telephony/callback.d.ts.map +1 -0
- package/dist/types/types/telephony/device/device-state.d.ts +30 -0
- package/dist/types/types/telephony/device/device-state.d.ts.map +1 -0
- package/dist/types/types/telephony/device/operational-state.d.ts +18 -0
- package/dist/types/types/telephony/device/operational-state.d.ts.map +1 -0
- package/dist/types/types/telephony/hunting-group-status.d.ts +25 -0
- package/dist/types/types/telephony/hunting-group-status.d.ts.map +1 -0
- package/dist/types/types/telephony/hunting-groups.d.ts +33 -0
- package/dist/types/types/telephony/hunting-groups.d.ts.map +1 -0
- package/dist/types/types/telephony/mini-message.d.ts +37 -0
- package/dist/types/types/telephony/mini-message.d.ts.map +1 -0
- package/dist/types/types/telephony/telephonic-state.d.ts +34 -0
- package/dist/types/types/telephony/telephonic-state.d.ts.map +1 -0
- package/dist/types/types/telephony/telephony-events.d.ts +223 -0
- package/dist/types/types/telephony/telephony-events.d.ts.map +1 -0
- package/dist/types/types/telephony/trunk-indentification.d.ts +19 -0
- package/dist/types/types/telephony/trunk-indentification.d.ts.map +1 -0
- package/dist/types/types/telephony/user/user-state.d.ts +18 -0
- package/dist/types/types/telephony/user/user-state.d.ts.map +1 -0
- package/dist/types/types/users/preferences.d.ts +29 -0
- package/dist/types/types/users/preferences.d.ts.map +1 -0
- package/dist/types/types/users/supported-languages.d.ts +29 -0
- package/dist/types/types/users/supported-languages.d.ts.map +1 -0
- package/dist/types/types/users/user.d.ts +67 -0
- package/dist/types/types/users/user.d.ts.map +1 -0
- package/dist/types/types/users/users-events.d.ts +78 -0
- package/dist/types/types/users/users-events.d.ts.map +1 -0
- package/dist/types/types/users/voicemail-type.d.ts +18 -0
- package/dist/types/types/users/voicemail-type.d.ts.map +1 -0
- package/dist/types/types/users/voicemail.d.ts +20 -0
- package/dist/types/types/users/voicemail.d.ts.map +1 -0
- package/package.json +6 -4
package/dist/o2g-node-sdk.js
CHANGED
|
@@ -4734,7 +4734,6 @@ const util_uri_1 = __importDefault(__webpack_require__(/*! ../util/util-uri */ "
|
|
|
4734
4734
|
const rest_service_1 = __webpack_require__(/*! ./rest-service */ "./src/internal/rest/rest-service.ts");
|
|
4735
4735
|
const cc_stat_types_1 = __webpack_require__(/*! ../types/cc-stat/cc-stat-types */ "./src/internal/types/cc-stat/cc-stat-types.ts");
|
|
4736
4736
|
const stats_data_1 = __webpack_require__(/*! ../../types/cc-stats/data/stats-data */ "./src/types/cc-stats/data/stats-data.ts");
|
|
4737
|
-
const format_1 = __webpack_require__(/*! date-fns/format */ "./node_modules/date-fns/format.cjs");
|
|
4738
4737
|
const stats_format_1 = __webpack_require__(/*! ../../types/cc-stats/stats-format */ "./src/types/cc-stats/stats-format.ts");
|
|
4739
4738
|
const events_1 = __webpack_require__(/*! events */ "events");
|
|
4740
4739
|
const on_stats_progress_1 = __webpack_require__(/*! ../types/cc-stat/on-stats-progress */ "./src/internal/types/cc-stat/on-stats-progress.ts");
|
|
@@ -4744,6 +4743,28 @@ const fs = __importStar(__webpack_require__(/*! fs */ "fs"));
|
|
|
4744
4743
|
const file_utils_1 = __webpack_require__(/*! ../util/file-utils */ "./src/internal/util/file-utils.ts");
|
|
4745
4744
|
const http_content_1 = __webpack_require__(/*! ../util/http-content */ "./src/internal/util/http-content.ts");
|
|
4746
4745
|
const scheduled_rep_impl_1 = __webpack_require__(/*! ../types/cc-stat/scheduled-rep-impl */ "./src/internal/types/cc-stat/scheduled-rep-impl.ts");
|
|
4746
|
+
/**
|
|
4747
|
+
* Formats a Date as 'yyyy-MM-dd HH:mm' using native JS.
|
|
4748
|
+
* @internal
|
|
4749
|
+
*/
|
|
4750
|
+
function formatDateTime(date) {
|
|
4751
|
+
const yyyy = date.getFullYear();
|
|
4752
|
+
const MM = String(date.getMonth() + 1).padStart(2, '0');
|
|
4753
|
+
const dd = String(date.getDate()).padStart(2, '0');
|
|
4754
|
+
const HH = String(date.getHours()).padStart(2, '0');
|
|
4755
|
+
const mm = String(date.getMinutes()).padStart(2, '0');
|
|
4756
|
+
return `${yyyy}-${MM}-${dd} ${HH}:${mm}`;
|
|
4757
|
+
}
|
|
4758
|
+
/**
|
|
4759
|
+
* Formats a Date as 'yyyy-MM-dd' using native JS.
|
|
4760
|
+
* @internal
|
|
4761
|
+
*/
|
|
4762
|
+
function formatDate(date) {
|
|
4763
|
+
const yyyy = date.getFullYear();
|
|
4764
|
+
const MM = String(date.getMonth() + 1).padStart(2, '0');
|
|
4765
|
+
const dd = String(date.getDate()).padStart(2, '0');
|
|
4766
|
+
return `${yyyy}-${MM}-${dd}`;
|
|
4767
|
+
}
|
|
4747
4768
|
/**
|
|
4748
4769
|
* Helper class to manage asynchronous statistic file requests.
|
|
4749
4770
|
*/
|
|
@@ -4751,28 +4772,23 @@ class StatAsyncRequest {
|
|
|
4751
4772
|
constructor(directory, progressCallback) {
|
|
4752
4773
|
this.directory = directory;
|
|
4753
4774
|
this.progressCallback = progressCallback;
|
|
4754
|
-
// Create a Promise and keep references to resolve/reject
|
|
4755
4775
|
this.promise = new Promise((resolve, reject) => {
|
|
4756
4776
|
this._resolve = resolve;
|
|
4757
4777
|
this._reject = reject;
|
|
4758
4778
|
});
|
|
4759
4779
|
}
|
|
4760
|
-
/** Returns the directory for this request */
|
|
4761
4780
|
getDirectory() {
|
|
4762
4781
|
return this.directory;
|
|
4763
4782
|
}
|
|
4764
|
-
/** Reports progress to the callback */
|
|
4765
4783
|
reportProgress(step, nbObjects, processedObjects) {
|
|
4766
4784
|
if (this.progressCallback) {
|
|
4767
4785
|
const progress = nbObjects > 0 ? Math.floor((processedObjects / nbObjects) * 100) : 0;
|
|
4768
4786
|
this.progressCallback(step, progress);
|
|
4769
4787
|
}
|
|
4770
4788
|
}
|
|
4771
|
-
/** Resolves the internal promise with the file path */
|
|
4772
4789
|
complete(filePath) {
|
|
4773
4790
|
this._resolve(filePath);
|
|
4774
4791
|
}
|
|
4775
|
-
/** Rejects the internal promise with an error */
|
|
4776
4792
|
fail(reason) {
|
|
4777
4793
|
this._reject(reason);
|
|
4778
4794
|
}
|
|
@@ -4784,39 +4800,28 @@ class CallCenterStatisticsRest extends rest_service_1.RestService {
|
|
|
4784
4800
|
_CallCenterStatisticsRest_currentAsyncRequest.set(this, null);
|
|
4785
4801
|
_CallCenterStatisticsRest_running.set(this, false);
|
|
4786
4802
|
_CallCenterStatisticsRest_eventEmitter.set(this, new events_1.EventEmitter());
|
|
4787
|
-
// factory method to instanciate a StatAsyncRequest
|
|
4788
4803
|
this.createAsyncRequest = (dir, cb) => new StatAsyncRequest(dir, cb);
|
|
4789
|
-
// register eventing
|
|
4790
4804
|
eventRegistry.register(__classPrivateFieldGet(this, _CallCenterStatisticsRest_eventEmitter, "f"), ON_ACD_STATS_PROGRESS, on_stats_progress_1.OnAcdStatsProgress);
|
|
4791
|
-
// And subsribe to events
|
|
4792
4805
|
__classPrivateFieldGet(this, _CallCenterStatisticsRest_eventEmitter, "f").on(ON_ACD_STATS_PROGRESS, (e) => {
|
|
4793
4806
|
this.handleAcdStatsProgress(e);
|
|
4794
4807
|
});
|
|
4795
4808
|
}
|
|
4796
|
-
// Unzip the received buffer and save in in a file
|
|
4797
4809
|
saveInDirectory(httpResponse, directory) {
|
|
4798
4810
|
try {
|
|
4799
4811
|
if (!httpResponse || !httpResponse.response) {
|
|
4800
4812
|
return null;
|
|
4801
4813
|
}
|
|
4802
|
-
// Convert ArrayBuffer to Buffer
|
|
4803
4814
|
const compressedBuffer = Buffer.from(httpResponse.response);
|
|
4804
|
-
// Unzip content
|
|
4805
4815
|
const zip = new adm_zip_1.default(compressedBuffer);
|
|
4806
4816
|
const entries = zip.getEntries();
|
|
4807
4817
|
if (!entries || entries.length === 0) {
|
|
4808
4818
|
return null;
|
|
4809
4819
|
}
|
|
4810
|
-
// Ensure directory exists (equivalent to Files.createDirectories)
|
|
4811
4820
|
fs.mkdirSync(directory, { recursive: true });
|
|
4812
|
-
// Take first file in ZIP (same as Java logic)
|
|
4813
4821
|
const firstEntry = entries[0];
|
|
4814
4822
|
const fileName = firstEntry.entryName;
|
|
4815
|
-
// Build timestamped file path
|
|
4816
4823
|
const filePath = file_utils_1.FileUtil.withTimestamp(directory, fileName);
|
|
4817
|
-
// Extract file content
|
|
4818
4824
|
const fileData = firstEntry.getData();
|
|
4819
|
-
// Write file
|
|
4820
4825
|
fs.writeFileSync(filePath, fileData);
|
|
4821
4826
|
return filePath;
|
|
4822
4827
|
}
|
|
@@ -4825,13 +4830,11 @@ class CallCenterStatisticsRest extends rest_service_1.RestService {
|
|
|
4825
4830
|
return null;
|
|
4826
4831
|
}
|
|
4827
4832
|
}
|
|
4828
|
-
// Download a data file
|
|
4829
4833
|
async downloadDataFile(fileUri, directory, request) {
|
|
4830
4834
|
try {
|
|
4831
4835
|
const uriGet = util_uri_1.default.appendPath(util_uri_1.default.getBaseUri(this._uri), fileUri);
|
|
4832
4836
|
const filePath = this.saveInDirectory(await this._httpClient.get(uriGet, 'arrayBuffer'), directory);
|
|
4833
4837
|
if (filePath) {
|
|
4834
|
-
// Resolve the request promise
|
|
4835
4838
|
request.complete(filePath);
|
|
4836
4839
|
}
|
|
4837
4840
|
else {
|
|
@@ -4839,11 +4842,9 @@ class CallCenterStatisticsRest extends rest_service_1.RestService {
|
|
|
4839
4842
|
}
|
|
4840
4843
|
}
|
|
4841
4844
|
catch (error) {
|
|
4842
|
-
// Reject the request promise on error
|
|
4843
4845
|
request.fail(error);
|
|
4844
4846
|
}
|
|
4845
4847
|
}
|
|
4846
|
-
// Manage the O2G event
|
|
4847
4848
|
handleAcdStatsProgress(e) {
|
|
4848
4849
|
const step = e.step;
|
|
4849
4850
|
if (!__classPrivateFieldGet(this, _CallCenterStatisticsRest_currentAsyncRequest, "f")) {
|
|
@@ -4854,13 +4855,10 @@ class CallCenterStatisticsRest extends rest_service_1.RestService {
|
|
|
4854
4855
|
__classPrivateFieldGet(this, _CallCenterStatisticsRest_currentAsyncRequest, "f").reportProgress(progress_step_1.ProgressStep.COLLECTING, e.nbTotObjects, e.nbProcessedObjects);
|
|
4855
4856
|
break;
|
|
4856
4857
|
case cc_stat_types_1.AcdStatsProgressStep.PROCESSED:
|
|
4857
|
-
// Force a 100% value
|
|
4858
4858
|
__classPrivateFieldGet(this, _CallCenterStatisticsRest_currentAsyncRequest, "f").reportProgress(progress_step_1.ProgressStep.PROCESSED, 1, 1);
|
|
4859
4859
|
break;
|
|
4860
4860
|
case cc_stat_types_1.AcdStatsProgressStep.FORMATED:
|
|
4861
|
-
// Force a 100% value
|
|
4862
4861
|
__classPrivateFieldGet(this, _CallCenterStatisticsRest_currentAsyncRequest, "f").reportProgress(progress_step_1.ProgressStep.FORMATTED, 1, 1);
|
|
4863
|
-
// Trigger file download
|
|
4864
4862
|
this.downloadDataFile(e.fullResPath, __classPrivateFieldGet(this, _CallCenterStatisticsRest_currentAsyncRequest, "f").getDirectory(), __classPrivateFieldGet(this, _CallCenterStatisticsRest_currentAsyncRequest, "f"));
|
|
4865
4863
|
__classPrivateFieldSet(this, _CallCenterStatisticsRest_running, false, "f");
|
|
4866
4864
|
break;
|
|
@@ -4972,8 +4970,8 @@ class CallCenterStatisticsRest extends rest_service_1.RestService {
|
|
|
4972
4970
|
assert_1.AssertUtil.notNull(context, 'context');
|
|
4973
4971
|
assert_1.AssertUtil.notNull(range, 'range');
|
|
4974
4972
|
let uriGet = util_uri_1.default.appendPath(this._uri, 'scope', encodeURIComponent(context.requesterId), 'ctx', context.id, 'days/data');
|
|
4975
|
-
uriGet = util_uri_1.default.appendQuery(uriGet, 'begindate', (
|
|
4976
|
-
uriGet = util_uri_1.default.appendQuery(uriGet, 'enddate', (
|
|
4973
|
+
uriGet = util_uri_1.default.appendQuery(uriGet, 'begindate', formatDateTime(range.from));
|
|
4974
|
+
uriGet = util_uri_1.default.appendQuery(uriGet, 'enddate', formatDateTime(range.to));
|
|
4977
4975
|
uriGet = util_uri_1.default.appendQuery(uriGet, 'format', 'json');
|
|
4978
4976
|
const _json = this.getResult(await this._httpClient.get(uriGet));
|
|
4979
4977
|
if (!_json)
|
|
@@ -4984,7 +4982,7 @@ class CallCenterStatisticsRest extends rest_service_1.RestService {
|
|
|
4984
4982
|
let uriGet = util_uri_1.default.appendPath(this._uri, 'scope', encodeURIComponent(context.requesterId), 'ctx', context.id, 'oneday/data');
|
|
4985
4983
|
if (!date)
|
|
4986
4984
|
date = new Date();
|
|
4987
|
-
uriGet = util_uri_1.default.appendQuery(uriGet, 'date', (
|
|
4985
|
+
uriGet = util_uri_1.default.appendQuery(uriGet, 'date', formatDate(date));
|
|
4988
4986
|
if (timeInterval) {
|
|
4989
4987
|
uriGet = util_uri_1.default.appendQuery(uriGet, 'slotType', timeInterval);
|
|
4990
4988
|
}
|
|
@@ -5001,7 +4999,7 @@ class CallCenterStatisticsRest extends rest_service_1.RestService {
|
|
|
5001
4999
|
__classPrivateFieldSet(this, _CallCenterStatisticsRest_running, true, "f");
|
|
5002
5000
|
__classPrivateFieldSet(this, _CallCenterStatisticsRest_currentAsyncRequest, this.createAsyncRequest(assert_1.AssertUtil.notNull(directory, 'directory'), progressCallback), "f");
|
|
5003
5001
|
let uriGet = util_uri_1.default.appendPath(this._uri, 'scope', encodeURIComponent(context.requesterId), 'ctx', context.id, 'oneday/data');
|
|
5004
|
-
uriGet = util_uri_1.default.appendQuery(uriGet, 'date', (
|
|
5002
|
+
uriGet = util_uri_1.default.appendQuery(uriGet, 'date', formatDate(assert_1.AssertUtil.notNull(date, 'date')));
|
|
5005
5003
|
if (timeInterval) {
|
|
5006
5004
|
uriGet = util_uri_1.default.appendQuery(uriGet, 'slotType', timeInterval);
|
|
5007
5005
|
}
|
|
@@ -5028,9 +5026,8 @@ class CallCenterStatisticsRest extends rest_service_1.RestService {
|
|
|
5028
5026
|
__classPrivateFieldSet(this, _CallCenterStatisticsRest_running, true, "f");
|
|
5029
5027
|
__classPrivateFieldSet(this, _CallCenterStatisticsRest_currentAsyncRequest, this.createAsyncRequest(assert_1.AssertUtil.notNull(directory, 'directory'), progressCallback), "f");
|
|
5030
5028
|
let uriGet = util_uri_1.default.appendPath(this._uri, 'scope', encodeURIComponent(context.requesterId), 'ctx', context.id, 'days/data');
|
|
5031
|
-
uriGet = util_uri_1.default.appendQuery(uriGet, 'begindate', (
|
|
5032
|
-
uriGet = util_uri_1.default.appendQuery(uriGet, 'enddate', (
|
|
5033
|
-
uriGet = util_uri_1.default.appendQuery(uriGet, 'format', 'json');
|
|
5029
|
+
uriGet = util_uri_1.default.appendQuery(uriGet, 'begindate', formatDateTime(range.from));
|
|
5030
|
+
uriGet = util_uri_1.default.appendQuery(uriGet, 'enddate', formatDateTime(range.to));
|
|
5034
5031
|
if (statFormat == stats_format_1.StatsFormat.CSV) {
|
|
5035
5032
|
uriGet = util_uri_1.default.appendQuery(uriGet, 'format', 'csv');
|
|
5036
5033
|
}
|
|
@@ -8642,7 +8639,7 @@ var _RequesterImpl_id, _RequesterImpl_language, _RequesterImpl_timezone;
|
|
|
8642
8639
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8643
8640
|
exports.RequesterImpl = void 0;
|
|
8644
8641
|
/**
|
|
8645
|
-
*
|
|
8642
|
+
* `RequesterImpl` is an immutable implementation of {@link Requester}.
|
|
8646
8643
|
*
|
|
8647
8644
|
* It encapsulates the requester's identifier, preferred language, and
|
|
8648
8645
|
* time zone information.
|
|
@@ -9019,7 +9016,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
9019
9016
|
exports.FileUtil = void 0;
|
|
9020
9017
|
const os_1 = __importDefault(__webpack_require__(/*! os */ "os"));
|
|
9021
9018
|
const uuid_1 = __webpack_require__(/*! uuid */ "uuid");
|
|
9022
|
-
const format_1 = __webpack_require__(/*! date-fns/format */ "./node_modules/date-fns/format.cjs");
|
|
9023
9019
|
const path = __importStar(__webpack_require__(/*! path */ "path"));
|
|
9024
9020
|
/** @internal */
|
|
9025
9021
|
class FileUtil {
|
|
@@ -9035,15 +9031,19 @@ class FileUtil {
|
|
|
9035
9031
|
}
|
|
9036
9032
|
}
|
|
9037
9033
|
static withTimestamp(directory, fileName) {
|
|
9038
|
-
// Split name and extension
|
|
9039
9034
|
const parsed = path.parse(fileName);
|
|
9040
9035
|
const name = parsed.name;
|
|
9041
9036
|
const extension = parsed.ext;
|
|
9042
|
-
// Format timestamp: yyyyMMdd-HHmmss
|
|
9043
|
-
const
|
|
9044
|
-
|
|
9037
|
+
// Format timestamp: yyyyMMdd-HHmmss using native JS
|
|
9038
|
+
const now = new Date();
|
|
9039
|
+
const yyyy = now.getFullYear();
|
|
9040
|
+
const MM = String(now.getMonth() + 1).padStart(2, '0');
|
|
9041
|
+
const dd = String(now.getDate()).padStart(2, '0');
|
|
9042
|
+
const HH = String(now.getHours()).padStart(2, '0');
|
|
9043
|
+
const mm = String(now.getMinutes()).padStart(2, '0');
|
|
9044
|
+
const ss = String(now.getSeconds()).padStart(2, '0');
|
|
9045
|
+
const timestamp = `${yyyy}${MM}${dd}-${HH}${mm}${ss}`;
|
|
9045
9046
|
const newFileName = `${name}-${timestamp}${extension}`;
|
|
9046
|
-
// Resolve against directory
|
|
9047
9047
|
return path.join(directory, newFileName);
|
|
9048
9048
|
}
|
|
9049
9049
|
}
|
|
@@ -11225,7 +11225,7 @@ class CallCenterStatistics {
|
|
|
11225
11225
|
*
|
|
11226
11226
|
* @param requester - The requester who owns the context.
|
|
11227
11227
|
* @param contextId - The unique identifier of the context.
|
|
11228
|
-
* @returns The {@link
|
|
11228
|
+
* @returns The {@link StatsContext} if found and retrieval is successful; `null`
|
|
11229
11229
|
* if there is an error or if no context exists with the specified identifier.
|
|
11230
11230
|
*/
|
|
11231
11231
|
async getContext(requester, contextId) {
|
|
@@ -17064,6 +17064,9 @@ const operator_state_1 = __webpack_require__(/*! ./operator-state */ "./src/type
|
|
|
17064
17064
|
* Notification sent when an agent's skills have changed.
|
|
17065
17065
|
*/
|
|
17066
17066
|
class OnAgentSkillChanged {
|
|
17067
|
+
/**
|
|
17068
|
+
* @internal
|
|
17069
|
+
*/
|
|
17067
17070
|
constructor(loginName, skills) {
|
|
17068
17071
|
_OnAgentSkillChanged_loginName.set(this, void 0);
|
|
17069
17072
|
_OnAgentSkillChanged_skills.set(this, void 0);
|
|
@@ -17688,7 +17691,7 @@ var _WithdrawReason_index, _WithdrawReason_label;
|
|
|
17688
17691
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
17689
17692
|
exports.WithdrawReason = void 0;
|
|
17690
17693
|
/**
|
|
17691
|
-
*
|
|
17694
|
+
* `WithdrawReason` represents a reason why a CCD agent is in a withdraw state.
|
|
17692
17695
|
*
|
|
17693
17696
|
* Withdraw reasons are used by the CCD system for reporting and statistical purposes.
|
|
17694
17697
|
* They help to understand why an agent is temporarily unavailable for call distribution.
|
|
@@ -17715,7 +17718,7 @@ class WithdrawReason {
|
|
|
17715
17718
|
/**
|
|
17716
17719
|
* Returns the human-readable label describing this withdraw reason.
|
|
17717
17720
|
*
|
|
17718
|
-
* @returns The descriptive label for the reason, or
|
|
17721
|
+
* @returns The descriptive label for the reason, or `null` if none is set.
|
|
17719
17722
|
*/
|
|
17720
17723
|
get label() {
|
|
17721
17724
|
return __classPrivateFieldGet(this, _WithdrawReason_label, "f") ?? null;
|
|
@@ -20264,7 +20267,7 @@ var RtiOtherProcessingGroupAttributes;
|
|
|
20264
20267
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
20265
20268
|
exports.OtherProcessingGroupType = void 0;
|
|
20266
20269
|
/**
|
|
20267
|
-
*
|
|
20270
|
+
* `OtherProcessingGroupType` represents the different types of processing groups
|
|
20268
20271
|
* (other than agent groups).
|
|
20269
20272
|
*
|
|
20270
20273
|
* These types indicate the role or function of the processing group in the call center system.
|
|
@@ -20962,12 +20965,12 @@ exports.RtiObjectIdentifier = void 0;
|
|
|
20962
20965
|
* Represents a CCD object identifier for which real-time information is available.
|
|
20963
20966
|
*
|
|
20964
20967
|
* Instances of this class provide details about a CCD object, such as agents, pilots,
|
|
20965
|
-
* or queues, that can be monitored using the {@link
|
|
20968
|
+
* or queues, that can be monitored using the {@link CallCenterRealtime}.
|
|
20966
20969
|
*
|
|
20967
20970
|
* Each object includes a directory number, last name, first name, and a unique key.
|
|
20968
20971
|
* This class is typically used to retrieve and reference objects for real-time events.
|
|
20969
20972
|
*
|
|
20970
|
-
* @see
|
|
20973
|
+
* @see CallCenterRealtime
|
|
20971
20974
|
* @since 2.7.4
|
|
20972
20975
|
*/
|
|
20973
20976
|
class RtiObjectIdentifier {
|
|
@@ -21072,11 +21075,11 @@ const rti_object_identifier_1 = __webpack_require__(/*! ./rti-object-identifier
|
|
|
21072
21075
|
* This class groups CCD objects by type, including agents, pilots, queues, and processing groups
|
|
21073
21076
|
* (both agent and other). Each object is represented by an {@link RtiObjectIdentifier}.
|
|
21074
21077
|
*
|
|
21075
|
-
* Instances of this class are typically returned by the {@link
|
|
21078
|
+
* Instances of this class are typically returned by the {@link CallCenterRealtime}
|
|
21076
21079
|
* to provide the list of available CCD objects for which real-time data can be retrieved.
|
|
21077
21080
|
*
|
|
21078
|
-
* A {@link
|
|
21079
|
-
* {@link
|
|
21081
|
+
* A {@link CallCenterRealtime} can be created from an `RtiObjects` instance using
|
|
21082
|
+
* {@link createFilter} to subscribe only to the selected objects in real-time event monitoring.
|
|
21080
21083
|
*
|
|
21081
21084
|
* @see RtiObjectIdentifier
|
|
21082
21085
|
* @see RtiService
|
|
@@ -21149,7 +21152,7 @@ class RtiObjects {
|
|
|
21149
21152
|
* Creates a {@link RtiFilter} initialized with all CCD objects in this instance.
|
|
21150
21153
|
*
|
|
21151
21154
|
* The resulting filter can be used to create a real-time context for event monitoring
|
|
21152
|
-
* with {@link
|
|
21155
|
+
* with {@link CallCenterRealtime}. It includes all agents, pilots, queues, and processing groups
|
|
21153
21156
|
* present in this `RtiObjects` instance.
|
|
21154
21157
|
*
|
|
21155
21158
|
* @returns A {@link RtiFilter} containing all objects from this `RtiObjects` instance.
|
|
@@ -22112,6 +22115,9 @@ const stat_value_1 = __webpack_require__(/*! ./stat-value */ "./src/types/cc-sta
|
|
|
22112
22115
|
const agent_attributes_1 = __webpack_require__(/*! ../agent-attributes */ "./src/types/cc-stats/agent-attributes.ts");
|
|
22113
22116
|
const ag_by_pil_stats_row_1 = __webpack_require__(/*! ./ag-by-pil-stats-row */ "./src/types/cc-stats/data/ag-by-pil-stats-row.ts");
|
|
22114
22117
|
class AgentStatisticsRow {
|
|
22118
|
+
/**
|
|
22119
|
+
* @internal
|
|
22120
|
+
*/
|
|
22115
22121
|
constructor(json) {
|
|
22116
22122
|
this.values = new Map();
|
|
22117
22123
|
// Add a proper type for pilotAgentStatsRows
|
|
@@ -23097,6 +23103,9 @@ exports.PilotStatisticsRow = void 0;
|
|
|
23097
23103
|
const stat_value_1 = __webpack_require__(/*! ./stat-value */ "./src/types/cc-stats/data/stat-value.ts");
|
|
23098
23104
|
const pilot_attributes_1 = __webpack_require__(/*! ../pilot-attributes */ "./src/types/cc-stats/pilot-attributes.ts");
|
|
23099
23105
|
class PilotStatisticsRow {
|
|
23106
|
+
/**
|
|
23107
|
+
* @internal
|
|
23108
|
+
*/
|
|
23100
23109
|
constructor(json) {
|
|
23101
23110
|
this.values = new Map();
|
|
23102
23111
|
_PilotStatisticsRow_date.set(this, void 0);
|
|
@@ -24008,7 +24017,7 @@ exports.SelectedPeriod = void 0;
|
|
|
24008
24017
|
/**
|
|
24009
24018
|
* Defines a time range and granularity for retrieving statistical data.
|
|
24010
24019
|
*
|
|
24011
|
-
* A
|
|
24020
|
+
* A `SelectedPeriod` specifies both the observation duration and the temporal resolution
|
|
24012
24021
|
* (slot size) used when aggregating statistics. It is used when querying data or generating
|
|
24013
24022
|
* detailed or multi-day reports.
|
|
24014
24023
|
*
|
|
@@ -26134,7 +26143,7 @@ class Page {
|
|
|
26134
26143
|
* specified length.
|
|
26135
26144
|
*
|
|
26136
26145
|
* @param offset the page offset
|
|
26137
|
-
* @param
|
|
26146
|
+
* @param limit the page length
|
|
26138
26147
|
*/
|
|
26139
26148
|
constructor(offset, limit) {
|
|
26140
26149
|
this._offset = offset;
|
|
@@ -26356,7 +26365,7 @@ exports.QueryResult = void 0;
|
|
|
26356
26365
|
const com_record_1 = __webpack_require__(/*! ./com-record */ "./src/types/comlog/com-record.ts");
|
|
26357
26366
|
const page_1 = __webpack_require__(/*! ./page */ "./src/types/comlog/page.ts");
|
|
26358
26367
|
/**
|
|
26359
|
-
*
|
|
26368
|
+
* `QueryResult` represents the result of a communication log query.
|
|
26360
26369
|
*
|
|
26361
26370
|
* Instances of this class contain the records returned by a query, along with
|
|
26362
26371
|
* paging information and the total count of matching records.
|
|
@@ -26365,7 +26374,7 @@ const page_1 = __webpack_require__(/*! ./page */ "./src/types/comlog/page.ts");
|
|
|
26365
26374
|
* including the offset and limit, and can be used to navigate through pages
|
|
26366
26375
|
* of results.
|
|
26367
26376
|
*
|
|
26368
|
-
* Each
|
|
26377
|
+
* Each `QueryResult` contains:
|
|
26369
26378
|
* - The total number of records matching the query (`count`)
|
|
26370
26379
|
* - Paging information for the current result set (`page`)
|
|
26371
26380
|
* - The list of communication records (`records`)
|
|
@@ -26722,14 +26731,14 @@ var DayOfWeek;
|
|
|
26722
26731
|
[DayOfWeek.SUNDAY]: common_types_1.DayOfWeekJson.sunday,
|
|
26723
26732
|
};
|
|
26724
26733
|
/**
|
|
26725
|
-
*
|
|
26734
|
+
* @internal
|
|
26726
26735
|
*/
|
|
26727
26736
|
function fromJson(value) {
|
|
26728
26737
|
return jsonToDayOfWeek[value];
|
|
26729
26738
|
}
|
|
26730
26739
|
DayOfWeek.fromJson = fromJson;
|
|
26731
26740
|
/**
|
|
26732
|
-
*
|
|
26741
|
+
* @internal
|
|
26733
26742
|
*/
|
|
26734
26743
|
function toJson(value) {
|
|
26735
26744
|
return dayOfWeekToJson[value];
|
|
@@ -27019,7 +27028,7 @@ class Identifier {
|
|
|
27019
27028
|
/**
|
|
27020
27029
|
* Returns the login name of the participant.
|
|
27021
27030
|
*
|
|
27022
|
-
* @return the login name, or
|
|
27031
|
+
* @return the login name, or `null` if not available
|
|
27023
27032
|
*/
|
|
27024
27033
|
get loginName() {
|
|
27025
27034
|
return __classPrivateFieldGet(this, _Identifier_loginName, "f") ?? null;
|
|
@@ -27027,7 +27036,7 @@ class Identifier {
|
|
|
27027
27036
|
/**
|
|
27028
27037
|
* Returns the phone number of the participant.
|
|
27029
27038
|
*
|
|
27030
|
-
* @return the phone number, or
|
|
27039
|
+
* @return the phone number, or `null` if not available
|
|
27031
27040
|
*/
|
|
27032
27041
|
get phoneNumber() {
|
|
27033
27042
|
return __classPrivateFieldGet(this, _Identifier_phoneNumber, "f") ?? null;
|
|
@@ -30910,41 +30919,56 @@ exports.PbxAttribute = void 0;
|
|
|
30910
30919
|
const pbx_attr_map_1 = __webpack_require__(/*! ./pbx-attr-map */ "./src/types/pbxmngt/pbx-attr-map.ts");
|
|
30911
30920
|
/**
|
|
30912
30921
|
* Represents an attribute in a {@link PbxObject}.
|
|
30913
|
-
*
|
|
30914
30922
|
* <p>
|
|
30915
|
-
* A PbxAttribute can be of the following types:
|
|
30916
|
-
* </p>
|
|
30917
|
-
*
|
|
30923
|
+
* A `PbxAttribute` can be of the following types:
|
|
30918
30924
|
* <ul>
|
|
30919
30925
|
* <li><b>Integer</b>: Equivalent to a number value.</li>
|
|
30920
30926
|
* <li><b>Boolean</b>: Equivalent to a boolean value.</li>
|
|
30921
30927
|
* <li><b>Enumerated</b>: Limited set of string values.</li>
|
|
30922
30928
|
* <li><b>OctetString / ByteString</b>: Treated as a string value.</li>
|
|
30923
|
-
* <li><b>Sequence</b>: Structured data with named attributes
|
|
30924
|
-
*
|
|
30925
|
-
*
|
|
30926
|
-
*
|
|
30927
|
-
*
|
|
30928
|
-
*
|
|
30929
|
-
*
|
|
30930
|
-
*
|
|
30929
|
+
* <li><b>Sequence</b>: Structured data with named attributes:
|
|
30930
|
+
* ```
|
|
30931
|
+
* Skill := Sequence {
|
|
30932
|
+
* Skill_Nb := Integer,
|
|
30933
|
+
* Skill_Level := Integer,
|
|
30934
|
+
* Skill_Activate := Boolean
|
|
30935
|
+
* }
|
|
30936
|
+
* ```
|
|
30931
30937
|
* </li>
|
|
30932
|
-
* <li><b>Set</b>: List of attributes of the same type, either simple or sequences
|
|
30933
|
-
*
|
|
30934
|
-
*
|
|
30935
|
-
*
|
|
30936
|
-
*
|
|
30937
|
-
*
|
|
30938
|
-
*
|
|
30939
|
-
*
|
|
30940
|
-
*
|
|
30938
|
+
* <li><b>Set</b>: List of attributes of the same type, either simple or sequences:
|
|
30939
|
+
* ```
|
|
30940
|
+
* SimpleSet := Set { Item := OctetString }
|
|
30941
|
+
* SkillSet := Set { Item := Sequence {
|
|
30942
|
+
* Skill_Nb := Integer,
|
|
30943
|
+
* Skill_Level := Integer,
|
|
30944
|
+
* Skill_Activate := Boolean
|
|
30945
|
+
* }}
|
|
30946
|
+
* ```
|
|
30941
30947
|
* </li>
|
|
30942
30948
|
* </ul>
|
|
30949
|
+
*
|
|
30950
|
+
* @example
|
|
30951
|
+
* ```typescript
|
|
30952
|
+
* // Simple attributes — use for scalar values
|
|
30953
|
+
* const stationType = PbxAttribute.createString("StationType", "ANALOG");
|
|
30954
|
+
* const directory = PbxAttribute.createString("Directory", "60200");
|
|
30955
|
+
* const count = PbxAttribute.createInteger("MaxCalls", 5);
|
|
30956
|
+
* const enabled = PbxAttribute.createBoolean("Enabled", true);
|
|
30957
|
+
*
|
|
30958
|
+
* // Sequence — use for structured attributes
|
|
30959
|
+
* const skillMap = new PbxAttributeMap();
|
|
30960
|
+
* skillMap.add(PbxAttribute.createInteger("Skill_Nb", 1));
|
|
30961
|
+
* skillMap.add(PbxAttribute.createInteger("Skill_Level", 3));
|
|
30962
|
+
* skillMap.add(PbxAttribute.createBoolean("Skill_Activate", true));
|
|
30963
|
+
* const skill = PbxAttribute.createSequence("Skill", skillMap);
|
|
30964
|
+
*
|
|
30965
|
+
* // Use with PbxManagement to modify an object
|
|
30966
|
+
* await O2G.pbxManagement.setObject(1, "Subscriber", "60200", [stationType, directory]);
|
|
30967
|
+
* ```
|
|
30943
30968
|
*/
|
|
30944
30969
|
class PbxAttribute {
|
|
30945
30970
|
/**
|
|
30946
30971
|
* @internal
|
|
30947
|
-
* @param name - Optional attribute name
|
|
30948
30972
|
*/
|
|
30949
30973
|
constructor(name) {
|
|
30950
30974
|
_PbxAttribute_name.set(this, void 0);
|
|
@@ -30955,18 +30979,15 @@ class PbxAttribute {
|
|
|
30955
30979
|
}
|
|
30956
30980
|
/**
|
|
30957
30981
|
* Returns this attribute's name.
|
|
30958
|
-
*
|
|
30982
|
+
*
|
|
30983
|
+
* @returns the attribute name, or `null` if not set
|
|
30959
30984
|
*/
|
|
30960
30985
|
get name() {
|
|
30961
30986
|
return __classPrivateFieldGet(this, _PbxAttribute_name, "f") ?? null;
|
|
30962
30987
|
}
|
|
30963
30988
|
/**
|
|
30964
|
-
*
|
|
30965
|
-
* @param json - The {@link PbxAttributeJson} representation
|
|
30966
|
-
* @returns A new {@link PbxAttribute} instance
|
|
30967
|
-
* @ignore
|
|
30989
|
+
* @internal
|
|
30968
30990
|
*/
|
|
30969
|
-
/** @internal */
|
|
30970
30991
|
static fromJson(json) {
|
|
30971
30992
|
const attribute = new PbxAttribute(json.name);
|
|
30972
30993
|
__classPrivateFieldSet(attribute, _PbxAttribute_values, json.value ?? [], "f");
|
|
@@ -30976,11 +30997,7 @@ class PbxAttribute {
|
|
|
30976
30997
|
return attribute;
|
|
30977
30998
|
}
|
|
30978
30999
|
/**
|
|
30979
|
-
*
|
|
30980
|
-
* @param pbxAttribute - The parent attribute
|
|
30981
|
-
* @param name - Name of the nested attribute
|
|
30982
|
-
* @param json - JSON representation of the nested attribute
|
|
30983
|
-
* @ignore
|
|
31000
|
+
* @internal
|
|
30984
31001
|
*/
|
|
30985
31002
|
static addSequenceAttribute(pbxAttribute, name, json) {
|
|
30986
31003
|
if (!__classPrivateFieldGet(pbxAttribute, _PbxAttribute_sequenceMap, "f")) {
|
|
@@ -30991,10 +31008,11 @@ class PbxAttribute {
|
|
|
30991
31008
|
__classPrivateFieldGet(pbxAttribute, _PbxAttribute_sequenceMap, "f").add(attribute);
|
|
30992
31009
|
}
|
|
30993
31010
|
/**
|
|
30994
|
-
* Creates a new PbxAttribute representing a
|
|
30995
|
-
*
|
|
30996
|
-
* @param
|
|
30997
|
-
* @
|
|
31011
|
+
* Creates a new `PbxAttribute` representing a set of string values.
|
|
31012
|
+
*
|
|
31013
|
+
* @param attrName the attribute name
|
|
31014
|
+
* @param values the list of string values
|
|
31015
|
+
* @returns a new {@link PbxAttribute} instance
|
|
30998
31016
|
*/
|
|
30999
31017
|
static createSetOfStrings(attrName, values) {
|
|
31000
31018
|
const attribute = new PbxAttribute(attrName);
|
|
@@ -31002,10 +31020,11 @@ class PbxAttribute {
|
|
|
31002
31020
|
return attribute;
|
|
31003
31021
|
}
|
|
31004
31022
|
/**
|
|
31005
|
-
* Creates a new PbxAttribute of type String.
|
|
31006
|
-
*
|
|
31007
|
-
* @param
|
|
31008
|
-
* @
|
|
31023
|
+
* Creates a new `PbxAttribute` of type String.
|
|
31024
|
+
*
|
|
31025
|
+
* @param attrName the attribute name
|
|
31026
|
+
* @param value the string value
|
|
31027
|
+
* @returns a new {@link PbxAttribute} instance
|
|
31009
31028
|
*/
|
|
31010
31029
|
static createString(attrName, value) {
|
|
31011
31030
|
const attribute = new PbxAttribute(attrName);
|
|
@@ -31013,10 +31032,11 @@ class PbxAttribute {
|
|
|
31013
31032
|
return attribute;
|
|
31014
31033
|
}
|
|
31015
31034
|
/**
|
|
31016
|
-
* Creates a new PbxAttribute of type Boolean.
|
|
31017
|
-
*
|
|
31018
|
-
* @param
|
|
31019
|
-
* @
|
|
31035
|
+
* Creates a new `PbxAttribute` of type Boolean.
|
|
31036
|
+
*
|
|
31037
|
+
* @param attrName the attribute name
|
|
31038
|
+
* @param value the boolean value
|
|
31039
|
+
* @returns a new {@link PbxAttribute} instance
|
|
31020
31040
|
*/
|
|
31021
31041
|
static createBoolean(attrName, value) {
|
|
31022
31042
|
const attribute = new PbxAttribute(attrName);
|
|
@@ -31024,10 +31044,11 @@ class PbxAttribute {
|
|
|
31024
31044
|
return attribute;
|
|
31025
31045
|
}
|
|
31026
31046
|
/**
|
|
31027
|
-
* Creates a new PbxAttribute of type Integer.
|
|
31028
|
-
*
|
|
31029
|
-
* @param
|
|
31030
|
-
* @
|
|
31047
|
+
* Creates a new `PbxAttribute` of type Integer.
|
|
31048
|
+
*
|
|
31049
|
+
* @param attrName the attribute name
|
|
31050
|
+
* @param value the integer value
|
|
31051
|
+
* @returns a new {@link PbxAttribute} instance
|
|
31031
31052
|
*/
|
|
31032
31053
|
static createInteger(attrName, value) {
|
|
31033
31054
|
const attribute = new PbxAttribute(attrName);
|
|
@@ -31035,10 +31056,15 @@ class PbxAttribute {
|
|
|
31035
31056
|
return attribute;
|
|
31036
31057
|
}
|
|
31037
31058
|
/**
|
|
31038
|
-
* Creates a new PbxAttribute representing a Sequence.
|
|
31039
|
-
*
|
|
31040
|
-
*
|
|
31041
|
-
*
|
|
31059
|
+
* Creates a new `PbxAttribute` representing a Sequence.
|
|
31060
|
+
* <p>
|
|
31061
|
+
* A sequence is a structured attribute composed of named sub-attributes,
|
|
31062
|
+
* built using a {@link PbxAttributeMap}.
|
|
31063
|
+
*
|
|
31064
|
+
* @param attrName the attribute name
|
|
31065
|
+
* @param sequence the {@link PbxAttributeMap} representing the sequence
|
|
31066
|
+
* @returns a new {@link PbxAttribute} instance
|
|
31067
|
+
* @see createSequenceSet
|
|
31042
31068
|
*/
|
|
31043
31069
|
static createSequence(attrName, sequence) {
|
|
31044
31070
|
const attribute = new PbxAttribute(attrName);
|
|
@@ -31046,10 +31072,15 @@ class PbxAttribute {
|
|
|
31046
31072
|
return attribute;
|
|
31047
31073
|
}
|
|
31048
31074
|
/**
|
|
31049
|
-
* Creates a new PbxAttribute representing a Set of sequences.
|
|
31050
|
-
*
|
|
31051
|
-
*
|
|
31052
|
-
*
|
|
31075
|
+
* Creates a new `PbxAttribute` representing a Set of sequences.
|
|
31076
|
+
* <p>
|
|
31077
|
+
* A set of sequences is a repeated structured attribute where each entry is
|
|
31078
|
+
* a {@link PbxAttributeMap} with the same structure.
|
|
31079
|
+
*
|
|
31080
|
+
* @param attrName the attribute name
|
|
31081
|
+
* @param setOfSequences the list of {@link PbxAttributeMap} representing the sequences
|
|
31082
|
+
* @returns a new {@link PbxAttribute} instance
|
|
31083
|
+
* @see createSequence
|
|
31053
31084
|
*/
|
|
31054
31085
|
static createSequenceSet(attrName, setOfSequences) {
|
|
31055
31086
|
const attribute = new PbxAttribute(attrName);
|
|
@@ -31058,8 +31089,9 @@ class PbxAttribute {
|
|
|
31058
31089
|
}
|
|
31059
31090
|
/**
|
|
31060
31091
|
* Returns the attribute at the specified index in a Set of sequences.
|
|
31061
|
-
*
|
|
31062
|
-
* @
|
|
31092
|
+
*
|
|
31093
|
+
* @param index the index of the entry in the set
|
|
31094
|
+
* @returns the {@link PbxAttributeMap} at the specified index
|
|
31063
31095
|
* @throws Error if the attribute is not a Set
|
|
31064
31096
|
*/
|
|
31065
31097
|
getAt(index) {
|
|
@@ -31069,8 +31101,9 @@ class PbxAttribute {
|
|
|
31069
31101
|
return __classPrivateFieldGet(this, _PbxAttribute_attributeMaps, "f")[index];
|
|
31070
31102
|
}
|
|
31071
31103
|
/**
|
|
31072
|
-
* Returns this attribute as a sequence of attributes.
|
|
31073
|
-
*
|
|
31104
|
+
* Returns this attribute as a sequence of named sub-attributes.
|
|
31105
|
+
*
|
|
31106
|
+
* @returns the {@link PbxAttributeMap} representing the sequence
|
|
31074
31107
|
* @throws Error if the attribute is not a Sequence
|
|
31075
31108
|
*/
|
|
31076
31109
|
asAttributeMap() {
|
|
@@ -31081,7 +31114,8 @@ class PbxAttribute {
|
|
|
31081
31114
|
}
|
|
31082
31115
|
/**
|
|
31083
31116
|
* Returns this attribute as a list of {@link PbxAttributeMap}.
|
|
31084
|
-
*
|
|
31117
|
+
*
|
|
31118
|
+
* @returns the list of {@link PbxAttributeMap} representing the set of sequences
|
|
31085
31119
|
* @throws Error if the attribute is not a sequence set
|
|
31086
31120
|
*/
|
|
31087
31121
|
asListOfMaps() {
|
|
@@ -31092,8 +31126,9 @@ class PbxAttribute {
|
|
|
31092
31126
|
}
|
|
31093
31127
|
/**
|
|
31094
31128
|
* Returns this attribute value as a boolean.
|
|
31095
|
-
*
|
|
31096
|
-
* @
|
|
31129
|
+
*
|
|
31130
|
+
* @returns the boolean value
|
|
31131
|
+
* @throws Error if the value is not a valid boolean
|
|
31097
31132
|
*/
|
|
31098
31133
|
asBoolean() {
|
|
31099
31134
|
const value = this._assertUnique(__classPrivateFieldGet(this, _PbxAttribute_values, "f"));
|
|
@@ -31105,7 +31140,8 @@ class PbxAttribute {
|
|
|
31105
31140
|
}
|
|
31106
31141
|
/**
|
|
31107
31142
|
* Sets this attribute value as a boolean.
|
|
31108
|
-
*
|
|
31143
|
+
*
|
|
31144
|
+
* @param value the boolean value
|
|
31109
31145
|
*/
|
|
31110
31146
|
setBoolean(value) {
|
|
31111
31147
|
__classPrivateFieldSet(this, _PbxAttribute_values, [value ? 'true' : 'false'], "f");
|
|
@@ -31114,8 +31150,9 @@ class PbxAttribute {
|
|
|
31114
31150
|
}
|
|
31115
31151
|
/**
|
|
31116
31152
|
* Returns this attribute value as an integer.
|
|
31117
|
-
*
|
|
31118
|
-
* @
|
|
31153
|
+
*
|
|
31154
|
+
* @returns the integer value
|
|
31155
|
+
* @throws Error if the value is not a valid integer
|
|
31119
31156
|
*/
|
|
31120
31157
|
asInteger() {
|
|
31121
31158
|
const value = this._assertUnique(__classPrivateFieldGet(this, _PbxAttribute_values, "f"));
|
|
@@ -31127,7 +31164,8 @@ class PbxAttribute {
|
|
|
31127
31164
|
}
|
|
31128
31165
|
/**
|
|
31129
31166
|
* Sets this attribute value as an integer.
|
|
31130
|
-
*
|
|
31167
|
+
*
|
|
31168
|
+
* @param value the integer value
|
|
31131
31169
|
*/
|
|
31132
31170
|
setInteger(value) {
|
|
31133
31171
|
__classPrivateFieldSet(this, _PbxAttribute_values, [value.toString()], "f");
|
|
@@ -31136,14 +31174,16 @@ class PbxAttribute {
|
|
|
31136
31174
|
}
|
|
31137
31175
|
/**
|
|
31138
31176
|
* Returns this attribute value as a string.
|
|
31139
|
-
*
|
|
31177
|
+
*
|
|
31178
|
+
* @returns the string value
|
|
31140
31179
|
*/
|
|
31141
31180
|
asString() {
|
|
31142
31181
|
return this._assertUnique(__classPrivateFieldGet(this, _PbxAttribute_values, "f"));
|
|
31143
31182
|
}
|
|
31144
31183
|
/**
|
|
31145
31184
|
* Sets this attribute value as a string.
|
|
31146
|
-
*
|
|
31185
|
+
*
|
|
31186
|
+
* @param value the string value
|
|
31147
31187
|
*/
|
|
31148
31188
|
setString(value) {
|
|
31149
31189
|
__classPrivateFieldSet(this, _PbxAttribute_values, [value], "f");
|
|
@@ -31152,16 +31192,14 @@ class PbxAttribute {
|
|
|
31152
31192
|
}
|
|
31153
31193
|
/**
|
|
31154
31194
|
* Returns this attribute value as an enumerated string.
|
|
31155
|
-
*
|
|
31195
|
+
*
|
|
31196
|
+
* @returns the enumerated string value
|
|
31156
31197
|
*/
|
|
31157
31198
|
asEnum() {
|
|
31158
31199
|
return this.asString();
|
|
31159
31200
|
}
|
|
31160
31201
|
/**
|
|
31161
|
-
*
|
|
31162
|
-
* @param values - Array of string values
|
|
31163
|
-
* @returns The single string value
|
|
31164
|
-
* @throws Error if values array does not contain exactly one element
|
|
31202
|
+
* @internal
|
|
31165
31203
|
*/
|
|
31166
31204
|
_assertUnique(values) {
|
|
31167
31205
|
if (Array.isArray(values) && values.length === 1) {
|
|
@@ -31170,12 +31208,8 @@ class PbxAttribute {
|
|
|
31170
31208
|
throw new Error('Value is not a list with a unique element');
|
|
31171
31209
|
}
|
|
31172
31210
|
/**
|
|
31173
|
-
*
|
|
31174
|
-
* @param attr - The attribute to serialize
|
|
31175
|
-
* @returns Array of {@link PbxAttributeJson} objects
|
|
31176
|
-
* @ignore
|
|
31211
|
+
* @internal
|
|
31177
31212
|
*/
|
|
31178
|
-
/** @internal */
|
|
31179
31213
|
static toJson(attr) {
|
|
31180
31214
|
const listAttr = [];
|
|
31181
31215
|
if (__classPrivateFieldGet(attr, _PbxAttribute_sequenceMap, "f")) {
|
|
@@ -33172,9 +33206,9 @@ exports.RouteSession = void 0;
|
|
|
33172
33206
|
* RouteSession represents a route request session between a RSI point
|
|
33173
33207
|
* and an application.
|
|
33174
33208
|
* A route session is initiated by a RSI point by sending a
|
|
33175
|
-
* {@link
|
|
33209
|
+
* {@link ON_ROUTE_REQUEST}.
|
|
33176
33210
|
* The application selects a route and answers the request by calling
|
|
33177
|
-
* {@link
|
|
33211
|
+
* {@link routeSelect}.
|
|
33178
33212
|
*/
|
|
33179
33213
|
class RouteSession {
|
|
33180
33214
|
constructor(routeCrid, caller, called, routedCallRef) {
|
|
@@ -33542,7 +33576,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
33542
33576
|
exports.RsiPoint = void 0;
|
|
33543
33577
|
/**
|
|
33544
33578
|
* RsiPoint represents a RSI point. When a call is received by a RSI
|
|
33545
|
-
* routing point, a {@link
|
|
33579
|
+
* routing point, a {@link ON_ROUTE_REQUEST} is sent to the application.
|
|
33546
33580
|
*/
|
|
33547
33581
|
class RsiPoint {
|
|
33548
33582
|
constructor(number, name, node, registered) {
|
|
@@ -37962,3599 +37996,6 @@ module.exports = require("path");
|
|
|
37962
37996
|
"use strict";
|
|
37963
37997
|
module.exports = require("zlib");
|
|
37964
37998
|
|
|
37965
|
-
/***/ },
|
|
37966
|
-
|
|
37967
|
-
/***/ "./node_modules/date-fns/_lib/addLeadingZeros.cjs"
|
|
37968
|
-
/*!********************************************************!*\
|
|
37969
|
-
!*** ./node_modules/date-fns/_lib/addLeadingZeros.cjs ***!
|
|
37970
|
-
\********************************************************/
|
|
37971
|
-
(__unused_webpack_module, exports) {
|
|
37972
|
-
|
|
37973
|
-
"use strict";
|
|
37974
|
-
|
|
37975
|
-
exports.addLeadingZeros = addLeadingZeros;
|
|
37976
|
-
function addLeadingZeros(number, targetLength) {
|
|
37977
|
-
const sign = number < 0 ? "-" : "";
|
|
37978
|
-
const output = Math.abs(number).toString().padStart(targetLength, "0");
|
|
37979
|
-
return sign + output;
|
|
37980
|
-
}
|
|
37981
|
-
|
|
37982
|
-
|
|
37983
|
-
/***/ },
|
|
37984
|
-
|
|
37985
|
-
/***/ "./node_modules/date-fns/_lib/defaultLocale.cjs"
|
|
37986
|
-
/*!******************************************************!*\
|
|
37987
|
-
!*** ./node_modules/date-fns/_lib/defaultLocale.cjs ***!
|
|
37988
|
-
\******************************************************/
|
|
37989
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
37990
|
-
|
|
37991
|
-
"use strict";
|
|
37992
|
-
|
|
37993
|
-
Object.defineProperty(exports, "defaultLocale", ({
|
|
37994
|
-
enumerable: true,
|
|
37995
|
-
get: function () {
|
|
37996
|
-
return _index.enUS;
|
|
37997
|
-
},
|
|
37998
|
-
}));
|
|
37999
|
-
var _index = __webpack_require__(/*! ../locale/en-US.cjs */ "./node_modules/date-fns/locale/en-US.cjs");
|
|
38000
|
-
|
|
38001
|
-
|
|
38002
|
-
/***/ },
|
|
38003
|
-
|
|
38004
|
-
/***/ "./node_modules/date-fns/_lib/defaultOptions.cjs"
|
|
38005
|
-
/*!*******************************************************!*\
|
|
38006
|
-
!*** ./node_modules/date-fns/_lib/defaultOptions.cjs ***!
|
|
38007
|
-
\*******************************************************/
|
|
38008
|
-
(__unused_webpack_module, exports) {
|
|
38009
|
-
|
|
38010
|
-
"use strict";
|
|
38011
|
-
|
|
38012
|
-
exports.getDefaultOptions = getDefaultOptions;
|
|
38013
|
-
exports.setDefaultOptions = setDefaultOptions;
|
|
38014
|
-
|
|
38015
|
-
let defaultOptions = {};
|
|
38016
|
-
|
|
38017
|
-
function getDefaultOptions() {
|
|
38018
|
-
return defaultOptions;
|
|
38019
|
-
}
|
|
38020
|
-
|
|
38021
|
-
function setDefaultOptions(newOptions) {
|
|
38022
|
-
defaultOptions = newOptions;
|
|
38023
|
-
}
|
|
38024
|
-
|
|
38025
|
-
|
|
38026
|
-
/***/ },
|
|
38027
|
-
|
|
38028
|
-
/***/ "./node_modules/date-fns/_lib/format/formatters.cjs"
|
|
38029
|
-
/*!**********************************************************!*\
|
|
38030
|
-
!*** ./node_modules/date-fns/_lib/format/formatters.cjs ***!
|
|
38031
|
-
\**********************************************************/
|
|
38032
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
38033
|
-
|
|
38034
|
-
"use strict";
|
|
38035
|
-
|
|
38036
|
-
exports.formatters = void 0;
|
|
38037
|
-
var _index = __webpack_require__(/*! ../../getDayOfYear.cjs */ "./node_modules/date-fns/getDayOfYear.cjs");
|
|
38038
|
-
var _index2 = __webpack_require__(/*! ../../getISOWeek.cjs */ "./node_modules/date-fns/getISOWeek.cjs");
|
|
38039
|
-
var _index3 = __webpack_require__(/*! ../../getISOWeekYear.cjs */ "./node_modules/date-fns/getISOWeekYear.cjs");
|
|
38040
|
-
var _index4 = __webpack_require__(/*! ../../getWeek.cjs */ "./node_modules/date-fns/getWeek.cjs");
|
|
38041
|
-
var _index5 = __webpack_require__(/*! ../../getWeekYear.cjs */ "./node_modules/date-fns/getWeekYear.cjs");
|
|
38042
|
-
|
|
38043
|
-
var _index6 = __webpack_require__(/*! ../addLeadingZeros.cjs */ "./node_modules/date-fns/_lib/addLeadingZeros.cjs");
|
|
38044
|
-
var _index7 = __webpack_require__(/*! ./lightFormatters.cjs */ "./node_modules/date-fns/_lib/format/lightFormatters.cjs");
|
|
38045
|
-
|
|
38046
|
-
const dayPeriodEnum = {
|
|
38047
|
-
am: "am",
|
|
38048
|
-
pm: "pm",
|
|
38049
|
-
midnight: "midnight",
|
|
38050
|
-
noon: "noon",
|
|
38051
|
-
morning: "morning",
|
|
38052
|
-
afternoon: "afternoon",
|
|
38053
|
-
evening: "evening",
|
|
38054
|
-
night: "night",
|
|
38055
|
-
};
|
|
38056
|
-
|
|
38057
|
-
/*
|
|
38058
|
-
* | | Unit | | Unit |
|
|
38059
|
-
* |-----|--------------------------------|-----|--------------------------------|
|
|
38060
|
-
* | a | AM, PM | A* | Milliseconds in day |
|
|
38061
|
-
* | b | AM, PM, noon, midnight | B | Flexible day period |
|
|
38062
|
-
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
|
|
38063
|
-
* | d | Day of month | D | Day of year |
|
|
38064
|
-
* | e | Local day of week | E | Day of week |
|
|
38065
|
-
* | f | | F* | Day of week in month |
|
|
38066
|
-
* | g* | Modified Julian day | G | Era |
|
|
38067
|
-
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
38068
|
-
* | i! | ISO day of week | I! | ISO week of year |
|
|
38069
|
-
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
|
|
38070
|
-
* | k | Hour [1-24] | K | Hour [0-11] |
|
|
38071
|
-
* | l* | (deprecated) | L | Stand-alone month |
|
|
38072
|
-
* | m | Minute | M | Month |
|
|
38073
|
-
* | n | | N | |
|
|
38074
|
-
* | o! | Ordinal number modifier | O | Timezone (GMT) |
|
|
38075
|
-
* | p! | Long localized time | P! | Long localized date |
|
|
38076
|
-
* | q | Stand-alone quarter | Q | Quarter |
|
|
38077
|
-
* | r* | Related Gregorian year | R! | ISO week-numbering year |
|
|
38078
|
-
* | s | Second | S | Fraction of second |
|
|
38079
|
-
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
|
|
38080
|
-
* | u | Extended year | U* | Cyclic year |
|
|
38081
|
-
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
|
|
38082
|
-
* | w | Local week of year | W* | Week of month |
|
|
38083
|
-
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
|
|
38084
|
-
* | y | Year (abs) | Y | Local week-numbering year |
|
|
38085
|
-
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
|
|
38086
|
-
*
|
|
38087
|
-
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
38088
|
-
*
|
|
38089
|
-
* Letters marked by ! are non-standard, but implemented by date-fns:
|
|
38090
|
-
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
|
|
38091
|
-
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
|
|
38092
|
-
* i.e. 7 for Sunday, 1 for Monday, etc.
|
|
38093
|
-
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
|
|
38094
|
-
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
|
|
38095
|
-
* `R` is supposed to be used in conjunction with `I` and `i`
|
|
38096
|
-
* for universal ISO week-numbering date, whereas
|
|
38097
|
-
* `Y` is supposed to be used in conjunction with `w` and `e`
|
|
38098
|
-
* for week-numbering date specific to the locale.
|
|
38099
|
-
* - `P` is long localized date format
|
|
38100
|
-
* - `p` is long localized time format
|
|
38101
|
-
*/
|
|
38102
|
-
|
|
38103
|
-
const formatters = (exports.formatters = {
|
|
38104
|
-
// Era
|
|
38105
|
-
G: function (date, token, localize) {
|
|
38106
|
-
const era = date.getFullYear() > 0 ? 1 : 0;
|
|
38107
|
-
switch (token) {
|
|
38108
|
-
// AD, BC
|
|
38109
|
-
case "G":
|
|
38110
|
-
case "GG":
|
|
38111
|
-
case "GGG":
|
|
38112
|
-
return localize.era(era, { width: "abbreviated" });
|
|
38113
|
-
// A, B
|
|
38114
|
-
case "GGGGG":
|
|
38115
|
-
return localize.era(era, { width: "narrow" });
|
|
38116
|
-
// Anno Domini, Before Christ
|
|
38117
|
-
case "GGGG":
|
|
38118
|
-
default:
|
|
38119
|
-
return localize.era(era, { width: "wide" });
|
|
38120
|
-
}
|
|
38121
|
-
},
|
|
38122
|
-
|
|
38123
|
-
// Year
|
|
38124
|
-
y: function (date, token, localize) {
|
|
38125
|
-
// Ordinal number
|
|
38126
|
-
if (token === "yo") {
|
|
38127
|
-
const signedYear = date.getFullYear();
|
|
38128
|
-
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
38129
|
-
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
38130
|
-
return localize.ordinalNumber(year, { unit: "year" });
|
|
38131
|
-
}
|
|
38132
|
-
|
|
38133
|
-
return _index7.lightFormatters.y(date, token);
|
|
38134
|
-
},
|
|
38135
|
-
|
|
38136
|
-
// Local week-numbering year
|
|
38137
|
-
Y: function (date, token, localize, options) {
|
|
38138
|
-
const signedWeekYear = (0, _index5.getWeekYear)(date, options);
|
|
38139
|
-
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
38140
|
-
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
38141
|
-
|
|
38142
|
-
// Two digit year
|
|
38143
|
-
if (token === "YY") {
|
|
38144
|
-
const twoDigitYear = weekYear % 100;
|
|
38145
|
-
return (0, _index6.addLeadingZeros)(twoDigitYear, 2);
|
|
38146
|
-
}
|
|
38147
|
-
|
|
38148
|
-
// Ordinal number
|
|
38149
|
-
if (token === "Yo") {
|
|
38150
|
-
return localize.ordinalNumber(weekYear, { unit: "year" });
|
|
38151
|
-
}
|
|
38152
|
-
|
|
38153
|
-
// Padding
|
|
38154
|
-
return (0, _index6.addLeadingZeros)(weekYear, token.length);
|
|
38155
|
-
},
|
|
38156
|
-
|
|
38157
|
-
// ISO week-numbering year
|
|
38158
|
-
R: function (date, token) {
|
|
38159
|
-
const isoWeekYear = (0, _index3.getISOWeekYear)(date);
|
|
38160
|
-
|
|
38161
|
-
// Padding
|
|
38162
|
-
return (0, _index6.addLeadingZeros)(isoWeekYear, token.length);
|
|
38163
|
-
},
|
|
38164
|
-
|
|
38165
|
-
// Extended year. This is a single number designating the year of this calendar system.
|
|
38166
|
-
// The main difference between `y` and `u` localizers are B.C. years:
|
|
38167
|
-
// | Year | `y` | `u` |
|
|
38168
|
-
// |------|-----|-----|
|
|
38169
|
-
// | AC 1 | 1 | 1 |
|
|
38170
|
-
// | BC 1 | 1 | 0 |
|
|
38171
|
-
// | BC 2 | 2 | -1 |
|
|
38172
|
-
// Also `yy` always returns the last two digits of a year,
|
|
38173
|
-
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
38174
|
-
u: function (date, token) {
|
|
38175
|
-
const year = date.getFullYear();
|
|
38176
|
-
return (0, _index6.addLeadingZeros)(year, token.length);
|
|
38177
|
-
},
|
|
38178
|
-
|
|
38179
|
-
// Quarter
|
|
38180
|
-
Q: function (date, token, localize) {
|
|
38181
|
-
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
38182
|
-
switch (token) {
|
|
38183
|
-
// 1, 2, 3, 4
|
|
38184
|
-
case "Q":
|
|
38185
|
-
return String(quarter);
|
|
38186
|
-
// 01, 02, 03, 04
|
|
38187
|
-
case "QQ":
|
|
38188
|
-
return (0, _index6.addLeadingZeros)(quarter, 2);
|
|
38189
|
-
// 1st, 2nd, 3rd, 4th
|
|
38190
|
-
case "Qo":
|
|
38191
|
-
return localize.ordinalNumber(quarter, { unit: "quarter" });
|
|
38192
|
-
// Q1, Q2, Q3, Q4
|
|
38193
|
-
case "QQQ":
|
|
38194
|
-
return localize.quarter(quarter, {
|
|
38195
|
-
width: "abbreviated",
|
|
38196
|
-
context: "formatting",
|
|
38197
|
-
});
|
|
38198
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
38199
|
-
case "QQQQQ":
|
|
38200
|
-
return localize.quarter(quarter, {
|
|
38201
|
-
width: "narrow",
|
|
38202
|
-
context: "formatting",
|
|
38203
|
-
});
|
|
38204
|
-
// 1st quarter, 2nd quarter, ...
|
|
38205
|
-
case "QQQQ":
|
|
38206
|
-
default:
|
|
38207
|
-
return localize.quarter(quarter, {
|
|
38208
|
-
width: "wide",
|
|
38209
|
-
context: "formatting",
|
|
38210
|
-
});
|
|
38211
|
-
}
|
|
38212
|
-
},
|
|
38213
|
-
|
|
38214
|
-
// Stand-alone quarter
|
|
38215
|
-
q: function (date, token, localize) {
|
|
38216
|
-
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
38217
|
-
switch (token) {
|
|
38218
|
-
// 1, 2, 3, 4
|
|
38219
|
-
case "q":
|
|
38220
|
-
return String(quarter);
|
|
38221
|
-
// 01, 02, 03, 04
|
|
38222
|
-
case "qq":
|
|
38223
|
-
return (0, _index6.addLeadingZeros)(quarter, 2);
|
|
38224
|
-
// 1st, 2nd, 3rd, 4th
|
|
38225
|
-
case "qo":
|
|
38226
|
-
return localize.ordinalNumber(quarter, { unit: "quarter" });
|
|
38227
|
-
// Q1, Q2, Q3, Q4
|
|
38228
|
-
case "qqq":
|
|
38229
|
-
return localize.quarter(quarter, {
|
|
38230
|
-
width: "abbreviated",
|
|
38231
|
-
context: "standalone",
|
|
38232
|
-
});
|
|
38233
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
38234
|
-
case "qqqqq":
|
|
38235
|
-
return localize.quarter(quarter, {
|
|
38236
|
-
width: "narrow",
|
|
38237
|
-
context: "standalone",
|
|
38238
|
-
});
|
|
38239
|
-
// 1st quarter, 2nd quarter, ...
|
|
38240
|
-
case "qqqq":
|
|
38241
|
-
default:
|
|
38242
|
-
return localize.quarter(quarter, {
|
|
38243
|
-
width: "wide",
|
|
38244
|
-
context: "standalone",
|
|
38245
|
-
});
|
|
38246
|
-
}
|
|
38247
|
-
},
|
|
38248
|
-
|
|
38249
|
-
// Month
|
|
38250
|
-
M: function (date, token, localize) {
|
|
38251
|
-
const month = date.getMonth();
|
|
38252
|
-
switch (token) {
|
|
38253
|
-
case "M":
|
|
38254
|
-
case "MM":
|
|
38255
|
-
return _index7.lightFormatters.M(date, token);
|
|
38256
|
-
// 1st, 2nd, ..., 12th
|
|
38257
|
-
case "Mo":
|
|
38258
|
-
return localize.ordinalNumber(month + 1, { unit: "month" });
|
|
38259
|
-
// Jan, Feb, ..., Dec
|
|
38260
|
-
case "MMM":
|
|
38261
|
-
return localize.month(month, {
|
|
38262
|
-
width: "abbreviated",
|
|
38263
|
-
context: "formatting",
|
|
38264
|
-
});
|
|
38265
|
-
// J, F, ..., D
|
|
38266
|
-
case "MMMMM":
|
|
38267
|
-
return localize.month(month, {
|
|
38268
|
-
width: "narrow",
|
|
38269
|
-
context: "formatting",
|
|
38270
|
-
});
|
|
38271
|
-
// January, February, ..., December
|
|
38272
|
-
case "MMMM":
|
|
38273
|
-
default:
|
|
38274
|
-
return localize.month(month, { width: "wide", context: "formatting" });
|
|
38275
|
-
}
|
|
38276
|
-
},
|
|
38277
|
-
|
|
38278
|
-
// Stand-alone month
|
|
38279
|
-
L: function (date, token, localize) {
|
|
38280
|
-
const month = date.getMonth();
|
|
38281
|
-
switch (token) {
|
|
38282
|
-
// 1, 2, ..., 12
|
|
38283
|
-
case "L":
|
|
38284
|
-
return String(month + 1);
|
|
38285
|
-
// 01, 02, ..., 12
|
|
38286
|
-
case "LL":
|
|
38287
|
-
return (0, _index6.addLeadingZeros)(month + 1, 2);
|
|
38288
|
-
// 1st, 2nd, ..., 12th
|
|
38289
|
-
case "Lo":
|
|
38290
|
-
return localize.ordinalNumber(month + 1, { unit: "month" });
|
|
38291
|
-
// Jan, Feb, ..., Dec
|
|
38292
|
-
case "LLL":
|
|
38293
|
-
return localize.month(month, {
|
|
38294
|
-
width: "abbreviated",
|
|
38295
|
-
context: "standalone",
|
|
38296
|
-
});
|
|
38297
|
-
// J, F, ..., D
|
|
38298
|
-
case "LLLLL":
|
|
38299
|
-
return localize.month(month, {
|
|
38300
|
-
width: "narrow",
|
|
38301
|
-
context: "standalone",
|
|
38302
|
-
});
|
|
38303
|
-
// January, February, ..., December
|
|
38304
|
-
case "LLLL":
|
|
38305
|
-
default:
|
|
38306
|
-
return localize.month(month, { width: "wide", context: "standalone" });
|
|
38307
|
-
}
|
|
38308
|
-
},
|
|
38309
|
-
|
|
38310
|
-
// Local week of year
|
|
38311
|
-
w: function (date, token, localize, options) {
|
|
38312
|
-
const week = (0, _index4.getWeek)(date, options);
|
|
38313
|
-
|
|
38314
|
-
if (token === "wo") {
|
|
38315
|
-
return localize.ordinalNumber(week, { unit: "week" });
|
|
38316
|
-
}
|
|
38317
|
-
|
|
38318
|
-
return (0, _index6.addLeadingZeros)(week, token.length);
|
|
38319
|
-
},
|
|
38320
|
-
|
|
38321
|
-
// ISO week of year
|
|
38322
|
-
I: function (date, token, localize) {
|
|
38323
|
-
const isoWeek = (0, _index2.getISOWeek)(date);
|
|
38324
|
-
|
|
38325
|
-
if (token === "Io") {
|
|
38326
|
-
return localize.ordinalNumber(isoWeek, { unit: "week" });
|
|
38327
|
-
}
|
|
38328
|
-
|
|
38329
|
-
return (0, _index6.addLeadingZeros)(isoWeek, token.length);
|
|
38330
|
-
},
|
|
38331
|
-
|
|
38332
|
-
// Day of the month
|
|
38333
|
-
d: function (date, token, localize) {
|
|
38334
|
-
if (token === "do") {
|
|
38335
|
-
return localize.ordinalNumber(date.getDate(), { unit: "date" });
|
|
38336
|
-
}
|
|
38337
|
-
|
|
38338
|
-
return _index7.lightFormatters.d(date, token);
|
|
38339
|
-
},
|
|
38340
|
-
|
|
38341
|
-
// Day of year
|
|
38342
|
-
D: function (date, token, localize) {
|
|
38343
|
-
const dayOfYear = (0, _index.getDayOfYear)(date);
|
|
38344
|
-
|
|
38345
|
-
if (token === "Do") {
|
|
38346
|
-
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
|
|
38347
|
-
}
|
|
38348
|
-
|
|
38349
|
-
return (0, _index6.addLeadingZeros)(dayOfYear, token.length);
|
|
38350
|
-
},
|
|
38351
|
-
|
|
38352
|
-
// Day of week
|
|
38353
|
-
E: function (date, token, localize) {
|
|
38354
|
-
const dayOfWeek = date.getDay();
|
|
38355
|
-
switch (token) {
|
|
38356
|
-
// Tue
|
|
38357
|
-
case "E":
|
|
38358
|
-
case "EE":
|
|
38359
|
-
case "EEE":
|
|
38360
|
-
return localize.day(dayOfWeek, {
|
|
38361
|
-
width: "abbreviated",
|
|
38362
|
-
context: "formatting",
|
|
38363
|
-
});
|
|
38364
|
-
// T
|
|
38365
|
-
case "EEEEE":
|
|
38366
|
-
return localize.day(dayOfWeek, {
|
|
38367
|
-
width: "narrow",
|
|
38368
|
-
context: "formatting",
|
|
38369
|
-
});
|
|
38370
|
-
// Tu
|
|
38371
|
-
case "EEEEEE":
|
|
38372
|
-
return localize.day(dayOfWeek, {
|
|
38373
|
-
width: "short",
|
|
38374
|
-
context: "formatting",
|
|
38375
|
-
});
|
|
38376
|
-
// Tuesday
|
|
38377
|
-
case "EEEE":
|
|
38378
|
-
default:
|
|
38379
|
-
return localize.day(dayOfWeek, {
|
|
38380
|
-
width: "wide",
|
|
38381
|
-
context: "formatting",
|
|
38382
|
-
});
|
|
38383
|
-
}
|
|
38384
|
-
},
|
|
38385
|
-
|
|
38386
|
-
// Local day of week
|
|
38387
|
-
e: function (date, token, localize, options) {
|
|
38388
|
-
const dayOfWeek = date.getDay();
|
|
38389
|
-
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
38390
|
-
switch (token) {
|
|
38391
|
-
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
38392
|
-
case "e":
|
|
38393
|
-
return String(localDayOfWeek);
|
|
38394
|
-
// Padded numerical value
|
|
38395
|
-
case "ee":
|
|
38396
|
-
return (0, _index6.addLeadingZeros)(localDayOfWeek, 2);
|
|
38397
|
-
// 1st, 2nd, ..., 7th
|
|
38398
|
-
case "eo":
|
|
38399
|
-
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
|
|
38400
|
-
case "eee":
|
|
38401
|
-
return localize.day(dayOfWeek, {
|
|
38402
|
-
width: "abbreviated",
|
|
38403
|
-
context: "formatting",
|
|
38404
|
-
});
|
|
38405
|
-
// T
|
|
38406
|
-
case "eeeee":
|
|
38407
|
-
return localize.day(dayOfWeek, {
|
|
38408
|
-
width: "narrow",
|
|
38409
|
-
context: "formatting",
|
|
38410
|
-
});
|
|
38411
|
-
// Tu
|
|
38412
|
-
case "eeeeee":
|
|
38413
|
-
return localize.day(dayOfWeek, {
|
|
38414
|
-
width: "short",
|
|
38415
|
-
context: "formatting",
|
|
38416
|
-
});
|
|
38417
|
-
// Tuesday
|
|
38418
|
-
case "eeee":
|
|
38419
|
-
default:
|
|
38420
|
-
return localize.day(dayOfWeek, {
|
|
38421
|
-
width: "wide",
|
|
38422
|
-
context: "formatting",
|
|
38423
|
-
});
|
|
38424
|
-
}
|
|
38425
|
-
},
|
|
38426
|
-
|
|
38427
|
-
// Stand-alone local day of week
|
|
38428
|
-
c: function (date, token, localize, options) {
|
|
38429
|
-
const dayOfWeek = date.getDay();
|
|
38430
|
-
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
38431
|
-
switch (token) {
|
|
38432
|
-
// Numerical value (same as in `e`)
|
|
38433
|
-
case "c":
|
|
38434
|
-
return String(localDayOfWeek);
|
|
38435
|
-
// Padded numerical value
|
|
38436
|
-
case "cc":
|
|
38437
|
-
return (0, _index6.addLeadingZeros)(localDayOfWeek, token.length);
|
|
38438
|
-
// 1st, 2nd, ..., 7th
|
|
38439
|
-
case "co":
|
|
38440
|
-
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
|
|
38441
|
-
case "ccc":
|
|
38442
|
-
return localize.day(dayOfWeek, {
|
|
38443
|
-
width: "abbreviated",
|
|
38444
|
-
context: "standalone",
|
|
38445
|
-
});
|
|
38446
|
-
// T
|
|
38447
|
-
case "ccccc":
|
|
38448
|
-
return localize.day(dayOfWeek, {
|
|
38449
|
-
width: "narrow",
|
|
38450
|
-
context: "standalone",
|
|
38451
|
-
});
|
|
38452
|
-
// Tu
|
|
38453
|
-
case "cccccc":
|
|
38454
|
-
return localize.day(dayOfWeek, {
|
|
38455
|
-
width: "short",
|
|
38456
|
-
context: "standalone",
|
|
38457
|
-
});
|
|
38458
|
-
// Tuesday
|
|
38459
|
-
case "cccc":
|
|
38460
|
-
default:
|
|
38461
|
-
return localize.day(dayOfWeek, {
|
|
38462
|
-
width: "wide",
|
|
38463
|
-
context: "standalone",
|
|
38464
|
-
});
|
|
38465
|
-
}
|
|
38466
|
-
},
|
|
38467
|
-
|
|
38468
|
-
// ISO day of week
|
|
38469
|
-
i: function (date, token, localize) {
|
|
38470
|
-
const dayOfWeek = date.getDay();
|
|
38471
|
-
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
38472
|
-
switch (token) {
|
|
38473
|
-
// 2
|
|
38474
|
-
case "i":
|
|
38475
|
-
return String(isoDayOfWeek);
|
|
38476
|
-
// 02
|
|
38477
|
-
case "ii":
|
|
38478
|
-
return (0, _index6.addLeadingZeros)(isoDayOfWeek, token.length);
|
|
38479
|
-
// 2nd
|
|
38480
|
-
case "io":
|
|
38481
|
-
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
|
|
38482
|
-
// Tue
|
|
38483
|
-
case "iii":
|
|
38484
|
-
return localize.day(dayOfWeek, {
|
|
38485
|
-
width: "abbreviated",
|
|
38486
|
-
context: "formatting",
|
|
38487
|
-
});
|
|
38488
|
-
// T
|
|
38489
|
-
case "iiiii":
|
|
38490
|
-
return localize.day(dayOfWeek, {
|
|
38491
|
-
width: "narrow",
|
|
38492
|
-
context: "formatting",
|
|
38493
|
-
});
|
|
38494
|
-
// Tu
|
|
38495
|
-
case "iiiiii":
|
|
38496
|
-
return localize.day(dayOfWeek, {
|
|
38497
|
-
width: "short",
|
|
38498
|
-
context: "formatting",
|
|
38499
|
-
});
|
|
38500
|
-
// Tuesday
|
|
38501
|
-
case "iiii":
|
|
38502
|
-
default:
|
|
38503
|
-
return localize.day(dayOfWeek, {
|
|
38504
|
-
width: "wide",
|
|
38505
|
-
context: "formatting",
|
|
38506
|
-
});
|
|
38507
|
-
}
|
|
38508
|
-
},
|
|
38509
|
-
|
|
38510
|
-
// AM or PM
|
|
38511
|
-
a: function (date, token, localize) {
|
|
38512
|
-
const hours = date.getHours();
|
|
38513
|
-
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
38514
|
-
|
|
38515
|
-
switch (token) {
|
|
38516
|
-
case "a":
|
|
38517
|
-
case "aa":
|
|
38518
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
38519
|
-
width: "abbreviated",
|
|
38520
|
-
context: "formatting",
|
|
38521
|
-
});
|
|
38522
|
-
case "aaa":
|
|
38523
|
-
return localize
|
|
38524
|
-
.dayPeriod(dayPeriodEnumValue, {
|
|
38525
|
-
width: "abbreviated",
|
|
38526
|
-
context: "formatting",
|
|
38527
|
-
})
|
|
38528
|
-
.toLowerCase();
|
|
38529
|
-
case "aaaaa":
|
|
38530
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
38531
|
-
width: "narrow",
|
|
38532
|
-
context: "formatting",
|
|
38533
|
-
});
|
|
38534
|
-
case "aaaa":
|
|
38535
|
-
default:
|
|
38536
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
38537
|
-
width: "wide",
|
|
38538
|
-
context: "formatting",
|
|
38539
|
-
});
|
|
38540
|
-
}
|
|
38541
|
-
},
|
|
38542
|
-
|
|
38543
|
-
// AM, PM, midnight, noon
|
|
38544
|
-
b: function (date, token, localize) {
|
|
38545
|
-
const hours = date.getHours();
|
|
38546
|
-
let dayPeriodEnumValue;
|
|
38547
|
-
if (hours === 12) {
|
|
38548
|
-
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
38549
|
-
} else if (hours === 0) {
|
|
38550
|
-
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
|
38551
|
-
} else {
|
|
38552
|
-
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
38553
|
-
}
|
|
38554
|
-
|
|
38555
|
-
switch (token) {
|
|
38556
|
-
case "b":
|
|
38557
|
-
case "bb":
|
|
38558
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
38559
|
-
width: "abbreviated",
|
|
38560
|
-
context: "formatting",
|
|
38561
|
-
});
|
|
38562
|
-
case "bbb":
|
|
38563
|
-
return localize
|
|
38564
|
-
.dayPeriod(dayPeriodEnumValue, {
|
|
38565
|
-
width: "abbreviated",
|
|
38566
|
-
context: "formatting",
|
|
38567
|
-
})
|
|
38568
|
-
.toLowerCase();
|
|
38569
|
-
case "bbbbb":
|
|
38570
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
38571
|
-
width: "narrow",
|
|
38572
|
-
context: "formatting",
|
|
38573
|
-
});
|
|
38574
|
-
case "bbbb":
|
|
38575
|
-
default:
|
|
38576
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
38577
|
-
width: "wide",
|
|
38578
|
-
context: "formatting",
|
|
38579
|
-
});
|
|
38580
|
-
}
|
|
38581
|
-
},
|
|
38582
|
-
|
|
38583
|
-
// in the morning, in the afternoon, in the evening, at night
|
|
38584
|
-
B: function (date, token, localize) {
|
|
38585
|
-
const hours = date.getHours();
|
|
38586
|
-
let dayPeriodEnumValue;
|
|
38587
|
-
if (hours >= 17) {
|
|
38588
|
-
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
38589
|
-
} else if (hours >= 12) {
|
|
38590
|
-
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
|
38591
|
-
} else if (hours >= 4) {
|
|
38592
|
-
dayPeriodEnumValue = dayPeriodEnum.morning;
|
|
38593
|
-
} else {
|
|
38594
|
-
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
38595
|
-
}
|
|
38596
|
-
|
|
38597
|
-
switch (token) {
|
|
38598
|
-
case "B":
|
|
38599
|
-
case "BB":
|
|
38600
|
-
case "BBB":
|
|
38601
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
38602
|
-
width: "abbreviated",
|
|
38603
|
-
context: "formatting",
|
|
38604
|
-
});
|
|
38605
|
-
case "BBBBB":
|
|
38606
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
38607
|
-
width: "narrow",
|
|
38608
|
-
context: "formatting",
|
|
38609
|
-
});
|
|
38610
|
-
case "BBBB":
|
|
38611
|
-
default:
|
|
38612
|
-
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
38613
|
-
width: "wide",
|
|
38614
|
-
context: "formatting",
|
|
38615
|
-
});
|
|
38616
|
-
}
|
|
38617
|
-
},
|
|
38618
|
-
|
|
38619
|
-
// Hour [1-12]
|
|
38620
|
-
h: function (date, token, localize) {
|
|
38621
|
-
if (token === "ho") {
|
|
38622
|
-
let hours = date.getHours() % 12;
|
|
38623
|
-
if (hours === 0) hours = 12;
|
|
38624
|
-
return localize.ordinalNumber(hours, { unit: "hour" });
|
|
38625
|
-
}
|
|
38626
|
-
|
|
38627
|
-
return _index7.lightFormatters.h(date, token);
|
|
38628
|
-
},
|
|
38629
|
-
|
|
38630
|
-
// Hour [0-23]
|
|
38631
|
-
H: function (date, token, localize) {
|
|
38632
|
-
if (token === "Ho") {
|
|
38633
|
-
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
|
|
38634
|
-
}
|
|
38635
|
-
|
|
38636
|
-
return _index7.lightFormatters.H(date, token);
|
|
38637
|
-
},
|
|
38638
|
-
|
|
38639
|
-
// Hour [0-11]
|
|
38640
|
-
K: function (date, token, localize) {
|
|
38641
|
-
const hours = date.getHours() % 12;
|
|
38642
|
-
|
|
38643
|
-
if (token === "Ko") {
|
|
38644
|
-
return localize.ordinalNumber(hours, { unit: "hour" });
|
|
38645
|
-
}
|
|
38646
|
-
|
|
38647
|
-
return (0, _index6.addLeadingZeros)(hours, token.length);
|
|
38648
|
-
},
|
|
38649
|
-
|
|
38650
|
-
// Hour [1-24]
|
|
38651
|
-
k: function (date, token, localize) {
|
|
38652
|
-
let hours = date.getHours();
|
|
38653
|
-
if (hours === 0) hours = 24;
|
|
38654
|
-
|
|
38655
|
-
if (token === "ko") {
|
|
38656
|
-
return localize.ordinalNumber(hours, { unit: "hour" });
|
|
38657
|
-
}
|
|
38658
|
-
|
|
38659
|
-
return (0, _index6.addLeadingZeros)(hours, token.length);
|
|
38660
|
-
},
|
|
38661
|
-
|
|
38662
|
-
// Minute
|
|
38663
|
-
m: function (date, token, localize) {
|
|
38664
|
-
if (token === "mo") {
|
|
38665
|
-
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
|
|
38666
|
-
}
|
|
38667
|
-
|
|
38668
|
-
return _index7.lightFormatters.m(date, token);
|
|
38669
|
-
},
|
|
38670
|
-
|
|
38671
|
-
// Second
|
|
38672
|
-
s: function (date, token, localize) {
|
|
38673
|
-
if (token === "so") {
|
|
38674
|
-
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
|
|
38675
|
-
}
|
|
38676
|
-
|
|
38677
|
-
return _index7.lightFormatters.s(date, token);
|
|
38678
|
-
},
|
|
38679
|
-
|
|
38680
|
-
// Fraction of second
|
|
38681
|
-
S: function (date, token) {
|
|
38682
|
-
return _index7.lightFormatters.S(date, token);
|
|
38683
|
-
},
|
|
38684
|
-
|
|
38685
|
-
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
38686
|
-
X: function (date, token, _localize) {
|
|
38687
|
-
const timezoneOffset = date.getTimezoneOffset();
|
|
38688
|
-
|
|
38689
|
-
if (timezoneOffset === 0) {
|
|
38690
|
-
return "Z";
|
|
38691
|
-
}
|
|
38692
|
-
|
|
38693
|
-
switch (token) {
|
|
38694
|
-
// Hours and optional minutes
|
|
38695
|
-
case "X":
|
|
38696
|
-
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
38697
|
-
|
|
38698
|
-
// Hours, minutes and optional seconds without `:` delimiter
|
|
38699
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
38700
|
-
// so this token always has the same output as `XX`
|
|
38701
|
-
case "XXXX":
|
|
38702
|
-
case "XX": // Hours and minutes without `:` delimiter
|
|
38703
|
-
return formatTimezone(timezoneOffset);
|
|
38704
|
-
|
|
38705
|
-
// Hours, minutes and optional seconds with `:` delimiter
|
|
38706
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
38707
|
-
// so this token always has the same output as `XXX`
|
|
38708
|
-
case "XXXXX":
|
|
38709
|
-
case "XXX": // Hours and minutes with `:` delimiter
|
|
38710
|
-
default:
|
|
38711
|
-
return formatTimezone(timezoneOffset, ":");
|
|
38712
|
-
}
|
|
38713
|
-
},
|
|
38714
|
-
|
|
38715
|
-
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
38716
|
-
x: function (date, token, _localize) {
|
|
38717
|
-
const timezoneOffset = date.getTimezoneOffset();
|
|
38718
|
-
|
|
38719
|
-
switch (token) {
|
|
38720
|
-
// Hours and optional minutes
|
|
38721
|
-
case "x":
|
|
38722
|
-
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
38723
|
-
|
|
38724
|
-
// Hours, minutes and optional seconds without `:` delimiter
|
|
38725
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
38726
|
-
// so this token always has the same output as `xx`
|
|
38727
|
-
case "xxxx":
|
|
38728
|
-
case "xx": // Hours and minutes without `:` delimiter
|
|
38729
|
-
return formatTimezone(timezoneOffset);
|
|
38730
|
-
|
|
38731
|
-
// Hours, minutes and optional seconds with `:` delimiter
|
|
38732
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
38733
|
-
// so this token always has the same output as `xxx`
|
|
38734
|
-
case "xxxxx":
|
|
38735
|
-
case "xxx": // Hours and minutes with `:` delimiter
|
|
38736
|
-
default:
|
|
38737
|
-
return formatTimezone(timezoneOffset, ":");
|
|
38738
|
-
}
|
|
38739
|
-
},
|
|
38740
|
-
|
|
38741
|
-
// Timezone (GMT)
|
|
38742
|
-
O: function (date, token, _localize) {
|
|
38743
|
-
const timezoneOffset = date.getTimezoneOffset();
|
|
38744
|
-
|
|
38745
|
-
switch (token) {
|
|
38746
|
-
// Short
|
|
38747
|
-
case "O":
|
|
38748
|
-
case "OO":
|
|
38749
|
-
case "OOO":
|
|
38750
|
-
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
38751
|
-
// Long
|
|
38752
|
-
case "OOOO":
|
|
38753
|
-
default:
|
|
38754
|
-
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
38755
|
-
}
|
|
38756
|
-
},
|
|
38757
|
-
|
|
38758
|
-
// Timezone (specific non-location)
|
|
38759
|
-
z: function (date, token, _localize) {
|
|
38760
|
-
const timezoneOffset = date.getTimezoneOffset();
|
|
38761
|
-
|
|
38762
|
-
switch (token) {
|
|
38763
|
-
// Short
|
|
38764
|
-
case "z":
|
|
38765
|
-
case "zz":
|
|
38766
|
-
case "zzz":
|
|
38767
|
-
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
38768
|
-
// Long
|
|
38769
|
-
case "zzzz":
|
|
38770
|
-
default:
|
|
38771
|
-
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
38772
|
-
}
|
|
38773
|
-
},
|
|
38774
|
-
|
|
38775
|
-
// Seconds timestamp
|
|
38776
|
-
t: function (date, token, _localize) {
|
|
38777
|
-
const timestamp = Math.trunc(+date / 1000);
|
|
38778
|
-
return (0, _index6.addLeadingZeros)(timestamp, token.length);
|
|
38779
|
-
},
|
|
38780
|
-
|
|
38781
|
-
// Milliseconds timestamp
|
|
38782
|
-
T: function (date, token, _localize) {
|
|
38783
|
-
return (0, _index6.addLeadingZeros)(+date, token.length);
|
|
38784
|
-
},
|
|
38785
|
-
});
|
|
38786
|
-
|
|
38787
|
-
function formatTimezoneShort(offset, delimiter = "") {
|
|
38788
|
-
const sign = offset > 0 ? "-" : "+";
|
|
38789
|
-
const absOffset = Math.abs(offset);
|
|
38790
|
-
const hours = Math.trunc(absOffset / 60);
|
|
38791
|
-
const minutes = absOffset % 60;
|
|
38792
|
-
if (minutes === 0) {
|
|
38793
|
-
return sign + String(hours);
|
|
38794
|
-
}
|
|
38795
|
-
return (
|
|
38796
|
-
sign + String(hours) + delimiter + (0, _index6.addLeadingZeros)(minutes, 2)
|
|
38797
|
-
);
|
|
38798
|
-
}
|
|
38799
|
-
|
|
38800
|
-
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
|
|
38801
|
-
if (offset % 60 === 0) {
|
|
38802
|
-
const sign = offset > 0 ? "-" : "+";
|
|
38803
|
-
return sign + (0, _index6.addLeadingZeros)(Math.abs(offset) / 60, 2);
|
|
38804
|
-
}
|
|
38805
|
-
return formatTimezone(offset, delimiter);
|
|
38806
|
-
}
|
|
38807
|
-
|
|
38808
|
-
function formatTimezone(offset, delimiter = "") {
|
|
38809
|
-
const sign = offset > 0 ? "-" : "+";
|
|
38810
|
-
const absOffset = Math.abs(offset);
|
|
38811
|
-
const hours = (0, _index6.addLeadingZeros)(Math.trunc(absOffset / 60), 2);
|
|
38812
|
-
const minutes = (0, _index6.addLeadingZeros)(absOffset % 60, 2);
|
|
38813
|
-
return sign + hours + delimiter + minutes;
|
|
38814
|
-
}
|
|
38815
|
-
|
|
38816
|
-
|
|
38817
|
-
/***/ },
|
|
38818
|
-
|
|
38819
|
-
/***/ "./node_modules/date-fns/_lib/format/lightFormatters.cjs"
|
|
38820
|
-
/*!***************************************************************!*\
|
|
38821
|
-
!*** ./node_modules/date-fns/_lib/format/lightFormatters.cjs ***!
|
|
38822
|
-
\***************************************************************/
|
|
38823
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
38824
|
-
|
|
38825
|
-
"use strict";
|
|
38826
|
-
|
|
38827
|
-
exports.lightFormatters = void 0;
|
|
38828
|
-
var _index = __webpack_require__(/*! ../addLeadingZeros.cjs */ "./node_modules/date-fns/_lib/addLeadingZeros.cjs");
|
|
38829
|
-
|
|
38830
|
-
/*
|
|
38831
|
-
* | | Unit | | Unit |
|
|
38832
|
-
* |-----|--------------------------------|-----|--------------------------------|
|
|
38833
|
-
* | a | AM, PM | A* | |
|
|
38834
|
-
* | d | Day of month | D | |
|
|
38835
|
-
* | h | Hour [1-12] | H | Hour [0-23] |
|
|
38836
|
-
* | m | Minute | M | Month |
|
|
38837
|
-
* | s | Second | S | Fraction of second |
|
|
38838
|
-
* | y | Year (abs) | Y | |
|
|
38839
|
-
*
|
|
38840
|
-
* Letters marked by * are not implemented but reserved by Unicode standard.
|
|
38841
|
-
*/
|
|
38842
|
-
|
|
38843
|
-
const lightFormatters = (exports.lightFormatters = {
|
|
38844
|
-
// Year
|
|
38845
|
-
y(date, token) {
|
|
38846
|
-
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
|
|
38847
|
-
// | Year | y | yy | yyy | yyyy | yyyyy |
|
|
38848
|
-
// |----------|-------|----|-------|-------|-------|
|
|
38849
|
-
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
|
|
38850
|
-
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
|
|
38851
|
-
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
|
38852
|
-
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
|
38853
|
-
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
|
38854
|
-
|
|
38855
|
-
const signedYear = date.getFullYear();
|
|
38856
|
-
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
|
38857
|
-
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
38858
|
-
return (0, _index.addLeadingZeros)(
|
|
38859
|
-
token === "yy" ? year % 100 : year,
|
|
38860
|
-
token.length,
|
|
38861
|
-
);
|
|
38862
|
-
},
|
|
38863
|
-
|
|
38864
|
-
// Month
|
|
38865
|
-
M(date, token) {
|
|
38866
|
-
const month = date.getMonth();
|
|
38867
|
-
return token === "M"
|
|
38868
|
-
? String(month + 1)
|
|
38869
|
-
: (0, _index.addLeadingZeros)(month + 1, 2);
|
|
38870
|
-
},
|
|
38871
|
-
|
|
38872
|
-
// Day of the month
|
|
38873
|
-
d(date, token) {
|
|
38874
|
-
return (0, _index.addLeadingZeros)(date.getDate(), token.length);
|
|
38875
|
-
},
|
|
38876
|
-
|
|
38877
|
-
// AM or PM
|
|
38878
|
-
a(date, token) {
|
|
38879
|
-
const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
|
|
38880
|
-
|
|
38881
|
-
switch (token) {
|
|
38882
|
-
case "a":
|
|
38883
|
-
case "aa":
|
|
38884
|
-
return dayPeriodEnumValue.toUpperCase();
|
|
38885
|
-
case "aaa":
|
|
38886
|
-
return dayPeriodEnumValue;
|
|
38887
|
-
case "aaaaa":
|
|
38888
|
-
return dayPeriodEnumValue[0];
|
|
38889
|
-
case "aaaa":
|
|
38890
|
-
default:
|
|
38891
|
-
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
|
|
38892
|
-
}
|
|
38893
|
-
},
|
|
38894
|
-
|
|
38895
|
-
// Hour [1-12]
|
|
38896
|
-
h(date, token) {
|
|
38897
|
-
return (0, _index.addLeadingZeros)(
|
|
38898
|
-
date.getHours() % 12 || 12,
|
|
38899
|
-
token.length,
|
|
38900
|
-
);
|
|
38901
|
-
},
|
|
38902
|
-
|
|
38903
|
-
// Hour [0-23]
|
|
38904
|
-
H(date, token) {
|
|
38905
|
-
return (0, _index.addLeadingZeros)(date.getHours(), token.length);
|
|
38906
|
-
},
|
|
38907
|
-
|
|
38908
|
-
// Minute
|
|
38909
|
-
m(date, token) {
|
|
38910
|
-
return (0, _index.addLeadingZeros)(date.getMinutes(), token.length);
|
|
38911
|
-
},
|
|
38912
|
-
|
|
38913
|
-
// Second
|
|
38914
|
-
s(date, token) {
|
|
38915
|
-
return (0, _index.addLeadingZeros)(date.getSeconds(), token.length);
|
|
38916
|
-
},
|
|
38917
|
-
|
|
38918
|
-
// Fraction of second
|
|
38919
|
-
S(date, token) {
|
|
38920
|
-
const numberOfDigits = token.length;
|
|
38921
|
-
const milliseconds = date.getMilliseconds();
|
|
38922
|
-
const fractionalSeconds = Math.trunc(
|
|
38923
|
-
milliseconds * Math.pow(10, numberOfDigits - 3),
|
|
38924
|
-
);
|
|
38925
|
-
return (0, _index.addLeadingZeros)(fractionalSeconds, token.length);
|
|
38926
|
-
},
|
|
38927
|
-
});
|
|
38928
|
-
|
|
38929
|
-
|
|
38930
|
-
/***/ },
|
|
38931
|
-
|
|
38932
|
-
/***/ "./node_modules/date-fns/_lib/format/longFormatters.cjs"
|
|
38933
|
-
/*!**************************************************************!*\
|
|
38934
|
-
!*** ./node_modules/date-fns/_lib/format/longFormatters.cjs ***!
|
|
38935
|
-
\**************************************************************/
|
|
38936
|
-
(__unused_webpack_module, exports) {
|
|
38937
|
-
|
|
38938
|
-
"use strict";
|
|
38939
|
-
|
|
38940
|
-
exports.longFormatters = void 0;
|
|
38941
|
-
|
|
38942
|
-
const dateLongFormatter = (pattern, formatLong) => {
|
|
38943
|
-
switch (pattern) {
|
|
38944
|
-
case "P":
|
|
38945
|
-
return formatLong.date({ width: "short" });
|
|
38946
|
-
case "PP":
|
|
38947
|
-
return formatLong.date({ width: "medium" });
|
|
38948
|
-
case "PPP":
|
|
38949
|
-
return formatLong.date({ width: "long" });
|
|
38950
|
-
case "PPPP":
|
|
38951
|
-
default:
|
|
38952
|
-
return formatLong.date({ width: "full" });
|
|
38953
|
-
}
|
|
38954
|
-
};
|
|
38955
|
-
|
|
38956
|
-
const timeLongFormatter = (pattern, formatLong) => {
|
|
38957
|
-
switch (pattern) {
|
|
38958
|
-
case "p":
|
|
38959
|
-
return formatLong.time({ width: "short" });
|
|
38960
|
-
case "pp":
|
|
38961
|
-
return formatLong.time({ width: "medium" });
|
|
38962
|
-
case "ppp":
|
|
38963
|
-
return formatLong.time({ width: "long" });
|
|
38964
|
-
case "pppp":
|
|
38965
|
-
default:
|
|
38966
|
-
return formatLong.time({ width: "full" });
|
|
38967
|
-
}
|
|
38968
|
-
};
|
|
38969
|
-
|
|
38970
|
-
const dateTimeLongFormatter = (pattern, formatLong) => {
|
|
38971
|
-
const matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
38972
|
-
const datePattern = matchResult[1];
|
|
38973
|
-
const timePattern = matchResult[2];
|
|
38974
|
-
|
|
38975
|
-
if (!timePattern) {
|
|
38976
|
-
return dateLongFormatter(pattern, formatLong);
|
|
38977
|
-
}
|
|
38978
|
-
|
|
38979
|
-
let dateTimeFormat;
|
|
38980
|
-
|
|
38981
|
-
switch (datePattern) {
|
|
38982
|
-
case "P":
|
|
38983
|
-
dateTimeFormat = formatLong.dateTime({ width: "short" });
|
|
38984
|
-
break;
|
|
38985
|
-
case "PP":
|
|
38986
|
-
dateTimeFormat = formatLong.dateTime({ width: "medium" });
|
|
38987
|
-
break;
|
|
38988
|
-
case "PPP":
|
|
38989
|
-
dateTimeFormat = formatLong.dateTime({ width: "long" });
|
|
38990
|
-
break;
|
|
38991
|
-
case "PPPP":
|
|
38992
|
-
default:
|
|
38993
|
-
dateTimeFormat = formatLong.dateTime({ width: "full" });
|
|
38994
|
-
break;
|
|
38995
|
-
}
|
|
38996
|
-
|
|
38997
|
-
return dateTimeFormat
|
|
38998
|
-
.replace("{{date}}", dateLongFormatter(datePattern, formatLong))
|
|
38999
|
-
.replace("{{time}}", timeLongFormatter(timePattern, formatLong));
|
|
39000
|
-
};
|
|
39001
|
-
|
|
39002
|
-
const longFormatters = (exports.longFormatters = {
|
|
39003
|
-
p: timeLongFormatter,
|
|
39004
|
-
P: dateTimeLongFormatter,
|
|
39005
|
-
});
|
|
39006
|
-
|
|
39007
|
-
|
|
39008
|
-
/***/ },
|
|
39009
|
-
|
|
39010
|
-
/***/ "./node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs"
|
|
39011
|
-
/*!************************************************************************!*\
|
|
39012
|
-
!*** ./node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs ***!
|
|
39013
|
-
\************************************************************************/
|
|
39014
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
39015
|
-
|
|
39016
|
-
"use strict";
|
|
39017
|
-
|
|
39018
|
-
exports.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds;
|
|
39019
|
-
var _index = __webpack_require__(/*! ../toDate.cjs */ "./node_modules/date-fns/toDate.cjs");
|
|
39020
|
-
|
|
39021
|
-
/**
|
|
39022
|
-
* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
|
|
39023
|
-
* They usually appear for dates that denote time before the timezones were introduced
|
|
39024
|
-
* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
|
|
39025
|
-
* and GMT+01:00:00 after that date)
|
|
39026
|
-
*
|
|
39027
|
-
* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
|
|
39028
|
-
* which would lead to incorrect calculations.
|
|
39029
|
-
*
|
|
39030
|
-
* This function returns the timezone offset in milliseconds that takes seconds in account.
|
|
39031
|
-
*/
|
|
39032
|
-
function getTimezoneOffsetInMilliseconds(date) {
|
|
39033
|
-
const _date = (0, _index.toDate)(date);
|
|
39034
|
-
const utcDate = new Date(
|
|
39035
|
-
Date.UTC(
|
|
39036
|
-
_date.getFullYear(),
|
|
39037
|
-
_date.getMonth(),
|
|
39038
|
-
_date.getDate(),
|
|
39039
|
-
_date.getHours(),
|
|
39040
|
-
_date.getMinutes(),
|
|
39041
|
-
_date.getSeconds(),
|
|
39042
|
-
_date.getMilliseconds(),
|
|
39043
|
-
),
|
|
39044
|
-
);
|
|
39045
|
-
utcDate.setUTCFullYear(_date.getFullYear());
|
|
39046
|
-
return +date - +utcDate;
|
|
39047
|
-
}
|
|
39048
|
-
|
|
39049
|
-
|
|
39050
|
-
/***/ },
|
|
39051
|
-
|
|
39052
|
-
/***/ "./node_modules/date-fns/_lib/normalizeDates.cjs"
|
|
39053
|
-
/*!*******************************************************!*\
|
|
39054
|
-
!*** ./node_modules/date-fns/_lib/normalizeDates.cjs ***!
|
|
39055
|
-
\*******************************************************/
|
|
39056
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
39057
|
-
|
|
39058
|
-
"use strict";
|
|
39059
|
-
|
|
39060
|
-
exports.normalizeDates = normalizeDates;
|
|
39061
|
-
var _index = __webpack_require__(/*! ../constructFrom.cjs */ "./node_modules/date-fns/constructFrom.cjs");
|
|
39062
|
-
|
|
39063
|
-
function normalizeDates(context, ...dates) {
|
|
39064
|
-
const normalize = _index.constructFrom.bind(
|
|
39065
|
-
null,
|
|
39066
|
-
context || dates.find((date) => typeof date === "object"),
|
|
39067
|
-
);
|
|
39068
|
-
return dates.map(normalize);
|
|
39069
|
-
}
|
|
39070
|
-
|
|
39071
|
-
|
|
39072
|
-
/***/ },
|
|
39073
|
-
|
|
39074
|
-
/***/ "./node_modules/date-fns/_lib/protectedTokens.cjs"
|
|
39075
|
-
/*!********************************************************!*\
|
|
39076
|
-
!*** ./node_modules/date-fns/_lib/protectedTokens.cjs ***!
|
|
39077
|
-
\********************************************************/
|
|
39078
|
-
(__unused_webpack_module, exports) {
|
|
39079
|
-
|
|
39080
|
-
"use strict";
|
|
39081
|
-
|
|
39082
|
-
exports.isProtectedDayOfYearToken = isProtectedDayOfYearToken;
|
|
39083
|
-
exports.isProtectedWeekYearToken = isProtectedWeekYearToken;
|
|
39084
|
-
exports.warnOrThrowProtectedError = warnOrThrowProtectedError;
|
|
39085
|
-
const dayOfYearTokenRE = /^D+$/;
|
|
39086
|
-
const weekYearTokenRE = /^Y+$/;
|
|
39087
|
-
|
|
39088
|
-
const throwTokens = ["D", "DD", "YY", "YYYY"];
|
|
39089
|
-
|
|
39090
|
-
function isProtectedDayOfYearToken(token) {
|
|
39091
|
-
return dayOfYearTokenRE.test(token);
|
|
39092
|
-
}
|
|
39093
|
-
|
|
39094
|
-
function isProtectedWeekYearToken(token) {
|
|
39095
|
-
return weekYearTokenRE.test(token);
|
|
39096
|
-
}
|
|
39097
|
-
|
|
39098
|
-
function warnOrThrowProtectedError(token, format, input) {
|
|
39099
|
-
const _message = message(token, format, input);
|
|
39100
|
-
console.warn(_message);
|
|
39101
|
-
if (throwTokens.includes(token)) throw new RangeError(_message);
|
|
39102
|
-
}
|
|
39103
|
-
|
|
39104
|
-
function message(token, format, input) {
|
|
39105
|
-
const subject = token[0] === "Y" ? "years" : "days of the month";
|
|
39106
|
-
return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
39107
|
-
}
|
|
39108
|
-
|
|
39109
|
-
|
|
39110
|
-
/***/ },
|
|
39111
|
-
|
|
39112
|
-
/***/ "./node_modules/date-fns/constants.cjs"
|
|
39113
|
-
/*!*********************************************!*\
|
|
39114
|
-
!*** ./node_modules/date-fns/constants.cjs ***!
|
|
39115
|
-
\*********************************************/
|
|
39116
|
-
(__unused_webpack_module, exports) {
|
|
39117
|
-
|
|
39118
|
-
"use strict";
|
|
39119
|
-
|
|
39120
|
-
exports.secondsInYear =
|
|
39121
|
-
exports.secondsInWeek =
|
|
39122
|
-
exports.secondsInQuarter =
|
|
39123
|
-
exports.secondsInMonth =
|
|
39124
|
-
exports.secondsInMinute =
|
|
39125
|
-
exports.secondsInHour =
|
|
39126
|
-
exports.secondsInDay =
|
|
39127
|
-
exports.quartersInYear =
|
|
39128
|
-
exports.monthsInYear =
|
|
39129
|
-
exports.monthsInQuarter =
|
|
39130
|
-
exports.minutesInYear =
|
|
39131
|
-
exports.minutesInMonth =
|
|
39132
|
-
exports.minutesInHour =
|
|
39133
|
-
exports.minutesInDay =
|
|
39134
|
-
exports.minTime =
|
|
39135
|
-
exports.millisecondsInWeek =
|
|
39136
|
-
exports.millisecondsInSecond =
|
|
39137
|
-
exports.millisecondsInMinute =
|
|
39138
|
-
exports.millisecondsInHour =
|
|
39139
|
-
exports.millisecondsInDay =
|
|
39140
|
-
exports.maxTime =
|
|
39141
|
-
exports.daysInYear =
|
|
39142
|
-
exports.daysInWeek =
|
|
39143
|
-
exports.constructFromSymbol =
|
|
39144
|
-
void 0; /**
|
|
39145
|
-
* @module constants
|
|
39146
|
-
* @summary Useful constants
|
|
39147
|
-
* @description
|
|
39148
|
-
* Collection of useful date constants.
|
|
39149
|
-
*
|
|
39150
|
-
* The constants could be imported from `date-fns/constants`:
|
|
39151
|
-
*
|
|
39152
|
-
* ```ts
|
|
39153
|
-
* import { maxTime, minTime } from "date-fns/constants";
|
|
39154
|
-
*
|
|
39155
|
-
* function isAllowedTime(time) {
|
|
39156
|
-
* return time <= maxTime && time >= minTime;
|
|
39157
|
-
* }
|
|
39158
|
-
* ```
|
|
39159
|
-
*/
|
|
39160
|
-
|
|
39161
|
-
/**
|
|
39162
|
-
* @constant
|
|
39163
|
-
* @name daysInWeek
|
|
39164
|
-
* @summary Days in 1 week.
|
|
39165
|
-
*/
|
|
39166
|
-
const daysInWeek = (exports.daysInWeek = 7);
|
|
39167
|
-
|
|
39168
|
-
/**
|
|
39169
|
-
* @constant
|
|
39170
|
-
* @name daysInYear
|
|
39171
|
-
* @summary Days in 1 year.
|
|
39172
|
-
*
|
|
39173
|
-
* @description
|
|
39174
|
-
* How many days in a year.
|
|
39175
|
-
*
|
|
39176
|
-
* One years equals 365.2425 days according to the formula:
|
|
39177
|
-
*
|
|
39178
|
-
* > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
|
|
39179
|
-
* > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
|
|
39180
|
-
*/
|
|
39181
|
-
const daysInYear = (exports.daysInYear = 365.2425);
|
|
39182
|
-
|
|
39183
|
-
/**
|
|
39184
|
-
* @constant
|
|
39185
|
-
* @name maxTime
|
|
39186
|
-
* @summary Maximum allowed time.
|
|
39187
|
-
*
|
|
39188
|
-
* @example
|
|
39189
|
-
* import { maxTime } from "date-fns/constants";
|
|
39190
|
-
*
|
|
39191
|
-
* const isValid = 8640000000000001 <= maxTime;
|
|
39192
|
-
* //=> false
|
|
39193
|
-
*
|
|
39194
|
-
* new Date(8640000000000001);
|
|
39195
|
-
* //=> Invalid Date
|
|
39196
|
-
*/
|
|
39197
|
-
const maxTime = (exports.maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000);
|
|
39198
|
-
|
|
39199
|
-
/**
|
|
39200
|
-
* @constant
|
|
39201
|
-
* @name minTime
|
|
39202
|
-
* @summary Minimum allowed time.
|
|
39203
|
-
*
|
|
39204
|
-
* @example
|
|
39205
|
-
* import { minTime } from "date-fns/constants";
|
|
39206
|
-
*
|
|
39207
|
-
* const isValid = -8640000000000001 >= minTime;
|
|
39208
|
-
* //=> false
|
|
39209
|
-
*
|
|
39210
|
-
* new Date(-8640000000000001)
|
|
39211
|
-
* //=> Invalid Date
|
|
39212
|
-
*/
|
|
39213
|
-
const minTime = (exports.minTime = -maxTime);
|
|
39214
|
-
|
|
39215
|
-
/**
|
|
39216
|
-
* @constant
|
|
39217
|
-
* @name millisecondsInWeek
|
|
39218
|
-
* @summary Milliseconds in 1 week.
|
|
39219
|
-
*/
|
|
39220
|
-
const millisecondsInWeek = (exports.millisecondsInWeek = 604800000);
|
|
39221
|
-
|
|
39222
|
-
/**
|
|
39223
|
-
* @constant
|
|
39224
|
-
* @name millisecondsInDay
|
|
39225
|
-
* @summary Milliseconds in 1 day.
|
|
39226
|
-
*/
|
|
39227
|
-
const millisecondsInDay = (exports.millisecondsInDay = 86400000);
|
|
39228
|
-
|
|
39229
|
-
/**
|
|
39230
|
-
* @constant
|
|
39231
|
-
* @name millisecondsInMinute
|
|
39232
|
-
* @summary Milliseconds in 1 minute
|
|
39233
|
-
*/
|
|
39234
|
-
const millisecondsInMinute = (exports.millisecondsInMinute = 60000);
|
|
39235
|
-
|
|
39236
|
-
/**
|
|
39237
|
-
* @constant
|
|
39238
|
-
* @name millisecondsInHour
|
|
39239
|
-
* @summary Milliseconds in 1 hour
|
|
39240
|
-
*/
|
|
39241
|
-
const millisecondsInHour = (exports.millisecondsInHour = 3600000);
|
|
39242
|
-
|
|
39243
|
-
/**
|
|
39244
|
-
* @constant
|
|
39245
|
-
* @name millisecondsInSecond
|
|
39246
|
-
* @summary Milliseconds in 1 second
|
|
39247
|
-
*/
|
|
39248
|
-
const millisecondsInSecond = (exports.millisecondsInSecond = 1000);
|
|
39249
|
-
|
|
39250
|
-
/**
|
|
39251
|
-
* @constant
|
|
39252
|
-
* @name minutesInYear
|
|
39253
|
-
* @summary Minutes in 1 year.
|
|
39254
|
-
*/
|
|
39255
|
-
const minutesInYear = (exports.minutesInYear = 525600);
|
|
39256
|
-
|
|
39257
|
-
/**
|
|
39258
|
-
* @constant
|
|
39259
|
-
* @name minutesInMonth
|
|
39260
|
-
* @summary Minutes in 1 month.
|
|
39261
|
-
*/
|
|
39262
|
-
const minutesInMonth = (exports.minutesInMonth = 43200);
|
|
39263
|
-
|
|
39264
|
-
/**
|
|
39265
|
-
* @constant
|
|
39266
|
-
* @name minutesInDay
|
|
39267
|
-
* @summary Minutes in 1 day.
|
|
39268
|
-
*/
|
|
39269
|
-
const minutesInDay = (exports.minutesInDay = 1440);
|
|
39270
|
-
|
|
39271
|
-
/**
|
|
39272
|
-
* @constant
|
|
39273
|
-
* @name minutesInHour
|
|
39274
|
-
* @summary Minutes in 1 hour.
|
|
39275
|
-
*/
|
|
39276
|
-
const minutesInHour = (exports.minutesInHour = 60);
|
|
39277
|
-
|
|
39278
|
-
/**
|
|
39279
|
-
* @constant
|
|
39280
|
-
* @name monthsInQuarter
|
|
39281
|
-
* @summary Months in 1 quarter.
|
|
39282
|
-
*/
|
|
39283
|
-
const monthsInQuarter = (exports.monthsInQuarter = 3);
|
|
39284
|
-
|
|
39285
|
-
/**
|
|
39286
|
-
* @constant
|
|
39287
|
-
* @name monthsInYear
|
|
39288
|
-
* @summary Months in 1 year.
|
|
39289
|
-
*/
|
|
39290
|
-
const monthsInYear = (exports.monthsInYear = 12);
|
|
39291
|
-
|
|
39292
|
-
/**
|
|
39293
|
-
* @constant
|
|
39294
|
-
* @name quartersInYear
|
|
39295
|
-
* @summary Quarters in 1 year
|
|
39296
|
-
*/
|
|
39297
|
-
const quartersInYear = (exports.quartersInYear = 4);
|
|
39298
|
-
|
|
39299
|
-
/**
|
|
39300
|
-
* @constant
|
|
39301
|
-
* @name secondsInHour
|
|
39302
|
-
* @summary Seconds in 1 hour.
|
|
39303
|
-
*/
|
|
39304
|
-
const secondsInHour = (exports.secondsInHour = 3600);
|
|
39305
|
-
|
|
39306
|
-
/**
|
|
39307
|
-
* @constant
|
|
39308
|
-
* @name secondsInMinute
|
|
39309
|
-
* @summary Seconds in 1 minute.
|
|
39310
|
-
*/
|
|
39311
|
-
const secondsInMinute = (exports.secondsInMinute = 60);
|
|
39312
|
-
|
|
39313
|
-
/**
|
|
39314
|
-
* @constant
|
|
39315
|
-
* @name secondsInDay
|
|
39316
|
-
* @summary Seconds in 1 day.
|
|
39317
|
-
*/
|
|
39318
|
-
const secondsInDay = (exports.secondsInDay = secondsInHour * 24);
|
|
39319
|
-
|
|
39320
|
-
/**
|
|
39321
|
-
* @constant
|
|
39322
|
-
* @name secondsInWeek
|
|
39323
|
-
* @summary Seconds in 1 week.
|
|
39324
|
-
*/
|
|
39325
|
-
const secondsInWeek = (exports.secondsInWeek = secondsInDay * 7);
|
|
39326
|
-
|
|
39327
|
-
/**
|
|
39328
|
-
* @constant
|
|
39329
|
-
* @name secondsInYear
|
|
39330
|
-
* @summary Seconds in 1 year.
|
|
39331
|
-
*/
|
|
39332
|
-
const secondsInYear = (exports.secondsInYear = secondsInDay * daysInYear);
|
|
39333
|
-
|
|
39334
|
-
/**
|
|
39335
|
-
* @constant
|
|
39336
|
-
* @name secondsInMonth
|
|
39337
|
-
* @summary Seconds in 1 month
|
|
39338
|
-
*/
|
|
39339
|
-
const secondsInMonth = (exports.secondsInMonth = secondsInYear / 12);
|
|
39340
|
-
|
|
39341
|
-
/**
|
|
39342
|
-
* @constant
|
|
39343
|
-
* @name secondsInQuarter
|
|
39344
|
-
* @summary Seconds in 1 quarter.
|
|
39345
|
-
*/
|
|
39346
|
-
const secondsInQuarter = (exports.secondsInQuarter = secondsInMonth * 3);
|
|
39347
|
-
|
|
39348
|
-
/**
|
|
39349
|
-
* @constant
|
|
39350
|
-
* @name constructFromSymbol
|
|
39351
|
-
* @summary Symbol enabling Date extensions to inherit properties from the reference date.
|
|
39352
|
-
*
|
|
39353
|
-
* The symbol is used to enable the `constructFrom` function to construct a date
|
|
39354
|
-
* using a reference date and a value. It allows to transfer extra properties
|
|
39355
|
-
* from the reference date to the new date. It's useful for extensions like
|
|
39356
|
-
* [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
|
|
39357
|
-
* a constructor argument.
|
|
39358
|
-
*/
|
|
39359
|
-
const constructFromSymbol = (exports.constructFromSymbol =
|
|
39360
|
-
Symbol.for("constructDateFrom"));
|
|
39361
|
-
|
|
39362
|
-
|
|
39363
|
-
/***/ },
|
|
39364
|
-
|
|
39365
|
-
/***/ "./node_modules/date-fns/constructFrom.cjs"
|
|
39366
|
-
/*!*************************************************!*\
|
|
39367
|
-
!*** ./node_modules/date-fns/constructFrom.cjs ***!
|
|
39368
|
-
\*************************************************/
|
|
39369
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
39370
|
-
|
|
39371
|
-
"use strict";
|
|
39372
|
-
|
|
39373
|
-
exports.constructFrom = constructFrom;
|
|
39374
|
-
var _index = __webpack_require__(/*! ./constants.cjs */ "./node_modules/date-fns/constants.cjs");
|
|
39375
|
-
|
|
39376
|
-
/**
|
|
39377
|
-
* @name constructFrom
|
|
39378
|
-
* @category Generic Helpers
|
|
39379
|
-
* @summary Constructs a date using the reference date and the value
|
|
39380
|
-
*
|
|
39381
|
-
* @description
|
|
39382
|
-
* The function constructs a new date using the constructor from the reference
|
|
39383
|
-
* date and the given value. It helps to build generic functions that accept
|
|
39384
|
-
* date extensions.
|
|
39385
|
-
*
|
|
39386
|
-
* It defaults to `Date` if the passed reference date is a number or a string.
|
|
39387
|
-
*
|
|
39388
|
-
* Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
|
|
39389
|
-
* enabling to transfer extra properties from the reference date to the new date.
|
|
39390
|
-
* It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
|
|
39391
|
-
* that accept a time zone as a constructor argument.
|
|
39392
|
-
*
|
|
39393
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
39394
|
-
*
|
|
39395
|
-
* @param date - The reference date to take constructor from
|
|
39396
|
-
* @param value - The value to create the date
|
|
39397
|
-
*
|
|
39398
|
-
* @returns Date initialized using the given date and value
|
|
39399
|
-
*
|
|
39400
|
-
* @example
|
|
39401
|
-
* import { constructFrom } from "date-fns";
|
|
39402
|
-
*
|
|
39403
|
-
* // A function that clones a date preserving the original type
|
|
39404
|
-
* function cloneDate<DateType extends Date>(date: DateType): DateType {
|
|
39405
|
-
* return constructFrom(
|
|
39406
|
-
* date, // Use constructor from the given date
|
|
39407
|
-
* date.getTime() // Use the date value to create a new date
|
|
39408
|
-
* );
|
|
39409
|
-
* }
|
|
39410
|
-
*/
|
|
39411
|
-
function constructFrom(date, value) {
|
|
39412
|
-
if (typeof date === "function") return date(value);
|
|
39413
|
-
|
|
39414
|
-
if (date && typeof date === "object" && _index.constructFromSymbol in date)
|
|
39415
|
-
return date[_index.constructFromSymbol](value);
|
|
39416
|
-
|
|
39417
|
-
if (date instanceof Date) return new date.constructor(value);
|
|
39418
|
-
|
|
39419
|
-
return new Date(value);
|
|
39420
|
-
}
|
|
39421
|
-
|
|
39422
|
-
|
|
39423
|
-
/***/ },
|
|
39424
|
-
|
|
39425
|
-
/***/ "./node_modules/date-fns/differenceInCalendarDays.cjs"
|
|
39426
|
-
/*!************************************************************!*\
|
|
39427
|
-
!*** ./node_modules/date-fns/differenceInCalendarDays.cjs ***!
|
|
39428
|
-
\************************************************************/
|
|
39429
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
39430
|
-
|
|
39431
|
-
"use strict";
|
|
39432
|
-
|
|
39433
|
-
exports.differenceInCalendarDays = differenceInCalendarDays;
|
|
39434
|
-
var _index = __webpack_require__(/*! ./_lib/getTimezoneOffsetInMilliseconds.cjs */ "./node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs");
|
|
39435
|
-
var _index2 = __webpack_require__(/*! ./_lib/normalizeDates.cjs */ "./node_modules/date-fns/_lib/normalizeDates.cjs");
|
|
39436
|
-
var _index3 = __webpack_require__(/*! ./constants.cjs */ "./node_modules/date-fns/constants.cjs");
|
|
39437
|
-
var _index4 = __webpack_require__(/*! ./startOfDay.cjs */ "./node_modules/date-fns/startOfDay.cjs");
|
|
39438
|
-
|
|
39439
|
-
/**
|
|
39440
|
-
* The {@link differenceInCalendarDays} function options.
|
|
39441
|
-
*/
|
|
39442
|
-
|
|
39443
|
-
/**
|
|
39444
|
-
* @name differenceInCalendarDays
|
|
39445
|
-
* @category Day Helpers
|
|
39446
|
-
* @summary Get the number of calendar days between the given dates.
|
|
39447
|
-
*
|
|
39448
|
-
* @description
|
|
39449
|
-
* Get the number of calendar days between the given dates. This means that the times are removed
|
|
39450
|
-
* from the dates and then the difference in days is calculated.
|
|
39451
|
-
*
|
|
39452
|
-
* @param laterDate - The later date
|
|
39453
|
-
* @param earlierDate - The earlier date
|
|
39454
|
-
* @param options - The options object
|
|
39455
|
-
*
|
|
39456
|
-
* @returns The number of calendar days
|
|
39457
|
-
*
|
|
39458
|
-
* @example
|
|
39459
|
-
* // How many calendar days are between
|
|
39460
|
-
* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
|
|
39461
|
-
* const result = differenceInCalendarDays(
|
|
39462
|
-
* new Date(2012, 6, 2, 0, 0),
|
|
39463
|
-
* new Date(2011, 6, 2, 23, 0)
|
|
39464
|
-
* )
|
|
39465
|
-
* //=> 366
|
|
39466
|
-
* // How many calendar days are between
|
|
39467
|
-
* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
|
|
39468
|
-
* const result = differenceInCalendarDays(
|
|
39469
|
-
* new Date(2011, 6, 3, 0, 1),
|
|
39470
|
-
* new Date(2011, 6, 2, 23, 59)
|
|
39471
|
-
* )
|
|
39472
|
-
* //=> 1
|
|
39473
|
-
*/
|
|
39474
|
-
function differenceInCalendarDays(laterDate, earlierDate, options) {
|
|
39475
|
-
const [laterDate_, earlierDate_] = (0, _index2.normalizeDates)(
|
|
39476
|
-
options?.in,
|
|
39477
|
-
laterDate,
|
|
39478
|
-
earlierDate,
|
|
39479
|
-
);
|
|
39480
|
-
|
|
39481
|
-
const laterStartOfDay = (0, _index4.startOfDay)(laterDate_);
|
|
39482
|
-
const earlierStartOfDay = (0, _index4.startOfDay)(earlierDate_);
|
|
39483
|
-
|
|
39484
|
-
const laterTimestamp =
|
|
39485
|
-
+laterStartOfDay -
|
|
39486
|
-
(0, _index.getTimezoneOffsetInMilliseconds)(laterStartOfDay);
|
|
39487
|
-
const earlierTimestamp =
|
|
39488
|
-
+earlierStartOfDay -
|
|
39489
|
-
(0, _index.getTimezoneOffsetInMilliseconds)(earlierStartOfDay);
|
|
39490
|
-
|
|
39491
|
-
// Round the number of days to the nearest integer because the number of
|
|
39492
|
-
// milliseconds in a day is not constant (e.g. it's different in the week of
|
|
39493
|
-
// the daylight saving time clock shift).
|
|
39494
|
-
return Math.round(
|
|
39495
|
-
(laterTimestamp - earlierTimestamp) / _index3.millisecondsInDay,
|
|
39496
|
-
);
|
|
39497
|
-
}
|
|
39498
|
-
|
|
39499
|
-
|
|
39500
|
-
/***/ },
|
|
39501
|
-
|
|
39502
|
-
/***/ "./node_modules/date-fns/format.cjs"
|
|
39503
|
-
/*!******************************************!*\
|
|
39504
|
-
!*** ./node_modules/date-fns/format.cjs ***!
|
|
39505
|
-
\******************************************/
|
|
39506
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
39507
|
-
|
|
39508
|
-
"use strict";
|
|
39509
|
-
|
|
39510
|
-
exports.format = exports.formatDate = format;
|
|
39511
|
-
Object.defineProperty(exports, "formatters", ({
|
|
39512
|
-
enumerable: true,
|
|
39513
|
-
get: function () {
|
|
39514
|
-
return _index3.formatters;
|
|
39515
|
-
},
|
|
39516
|
-
}));
|
|
39517
|
-
Object.defineProperty(exports, "longFormatters", ({
|
|
39518
|
-
enumerable: true,
|
|
39519
|
-
get: function () {
|
|
39520
|
-
return _index4.longFormatters;
|
|
39521
|
-
},
|
|
39522
|
-
}));
|
|
39523
|
-
var _index = __webpack_require__(/*! ./_lib/defaultLocale.cjs */ "./node_modules/date-fns/_lib/defaultLocale.cjs");
|
|
39524
|
-
var _index2 = __webpack_require__(/*! ./_lib/defaultOptions.cjs */ "./node_modules/date-fns/_lib/defaultOptions.cjs");
|
|
39525
|
-
var _index3 = __webpack_require__(/*! ./_lib/format/formatters.cjs */ "./node_modules/date-fns/_lib/format/formatters.cjs");
|
|
39526
|
-
var _index4 = __webpack_require__(/*! ./_lib/format/longFormatters.cjs */ "./node_modules/date-fns/_lib/format/longFormatters.cjs");
|
|
39527
|
-
var _index5 = __webpack_require__(/*! ./_lib/protectedTokens.cjs */ "./node_modules/date-fns/_lib/protectedTokens.cjs");
|
|
39528
|
-
|
|
39529
|
-
var _index6 = __webpack_require__(/*! ./isValid.cjs */ "./node_modules/date-fns/isValid.cjs");
|
|
39530
|
-
var _index7 = __webpack_require__(/*! ./toDate.cjs */ "./node_modules/date-fns/toDate.cjs");
|
|
39531
|
-
|
|
39532
|
-
// Rexports of internal for libraries to use.
|
|
39533
|
-
// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
|
|
39534
|
-
|
|
39535
|
-
// This RegExp consists of three parts separated by `|`:
|
|
39536
|
-
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
|
|
39537
|
-
// (one of the certain letters followed by `o`)
|
|
39538
|
-
// - (\w)\1* matches any sequences of the same letter
|
|
39539
|
-
// - '' matches two quote characters in a row
|
|
39540
|
-
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
|
|
39541
|
-
// except a single quote symbol, which ends the sequence.
|
|
39542
|
-
// Two quote characters do not end the sequence.
|
|
39543
|
-
// If there is no matching single quote
|
|
39544
|
-
// then the sequence will continue until the end of the string.
|
|
39545
|
-
// - . matches any single character unmatched by previous parts of the RegExps
|
|
39546
|
-
const formattingTokensRegExp =
|
|
39547
|
-
/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
39548
|
-
|
|
39549
|
-
// This RegExp catches symbols escaped by quotes, and also
|
|
39550
|
-
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
|
|
39551
|
-
const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
39552
|
-
|
|
39553
|
-
const escapedStringRegExp = /^'([^]*?)'?$/;
|
|
39554
|
-
const doubleQuoteRegExp = /''/g;
|
|
39555
|
-
const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
39556
|
-
|
|
39557
|
-
/**
|
|
39558
|
-
* The {@link format} function options.
|
|
39559
|
-
*/
|
|
39560
|
-
|
|
39561
|
-
/**
|
|
39562
|
-
* @name format
|
|
39563
|
-
* @alias formatDate
|
|
39564
|
-
* @category Common Helpers
|
|
39565
|
-
* @summary Format the date.
|
|
39566
|
-
*
|
|
39567
|
-
* @description
|
|
39568
|
-
* Return the formatted date string in the given format. The result may vary by locale.
|
|
39569
|
-
*
|
|
39570
|
-
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
|
|
39571
|
-
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
39572
|
-
*
|
|
39573
|
-
* The characters wrapped between two single quotes characters (') are escaped.
|
|
39574
|
-
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
|
|
39575
|
-
* (see the last example)
|
|
39576
|
-
*
|
|
39577
|
-
* Format of the string is based on Unicode Technical Standard #35:
|
|
39578
|
-
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
39579
|
-
* with a few additions (see note 7 below the table).
|
|
39580
|
-
*
|
|
39581
|
-
* Accepted patterns:
|
|
39582
|
-
* | Unit | Pattern | Result examples | Notes |
|
|
39583
|
-
* |---------------------------------|---------|-----------------------------------|-------|
|
|
39584
|
-
* | Era | G..GGG | AD, BC | |
|
|
39585
|
-
* | | GGGG | Anno Domini, Before Christ | 2 |
|
|
39586
|
-
* | | GGGGG | A, B | |
|
|
39587
|
-
* | Calendar year | y | 44, 1, 1900, 2017 | 5 |
|
|
39588
|
-
* | | yo | 44th, 1st, 0th, 17th | 5,7 |
|
|
39589
|
-
* | | yy | 44, 01, 00, 17 | 5 |
|
|
39590
|
-
* | | yyy | 044, 001, 1900, 2017 | 5 |
|
|
39591
|
-
* | | yyyy | 0044, 0001, 1900, 2017 | 5 |
|
|
39592
|
-
* | | yyyyy | ... | 3,5 |
|
|
39593
|
-
* | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
|
|
39594
|
-
* | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
|
|
39595
|
-
* | | YY | 44, 01, 00, 17 | 5,8 |
|
|
39596
|
-
* | | YYY | 044, 001, 1900, 2017 | 5 |
|
|
39597
|
-
* | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
|
|
39598
|
-
* | | YYYYY | ... | 3,5 |
|
|
39599
|
-
* | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
|
|
39600
|
-
* | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
|
|
39601
|
-
* | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
|
|
39602
|
-
* | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
|
|
39603
|
-
* | | RRRRR | ... | 3,5,7 |
|
|
39604
|
-
* | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
|
|
39605
|
-
* | | uu | -43, 01, 1900, 2017 | 5 |
|
|
39606
|
-
* | | uuu | -043, 001, 1900, 2017 | 5 |
|
|
39607
|
-
* | | uuuu | -0043, 0001, 1900, 2017 | 5 |
|
|
39608
|
-
* | | uuuuu | ... | 3,5 |
|
|
39609
|
-
* | Quarter (formatting) | Q | 1, 2, 3, 4 | |
|
|
39610
|
-
* | | Qo | 1st, 2nd, 3rd, 4th | 7 |
|
|
39611
|
-
* | | QQ | 01, 02, 03, 04 | |
|
|
39612
|
-
* | | QQQ | Q1, Q2, Q3, Q4 | |
|
|
39613
|
-
* | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
|
|
39614
|
-
* | | QQQQQ | 1, 2, 3, 4 | 4 |
|
|
39615
|
-
* | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
|
|
39616
|
-
* | | qo | 1st, 2nd, 3rd, 4th | 7 |
|
|
39617
|
-
* | | qq | 01, 02, 03, 04 | |
|
|
39618
|
-
* | | qqq | Q1, Q2, Q3, Q4 | |
|
|
39619
|
-
* | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
|
|
39620
|
-
* | | qqqqq | 1, 2, 3, 4 | 4 |
|
|
39621
|
-
* | Month (formatting) | M | 1, 2, ..., 12 | |
|
|
39622
|
-
* | | Mo | 1st, 2nd, ..., 12th | 7 |
|
|
39623
|
-
* | | MM | 01, 02, ..., 12 | |
|
|
39624
|
-
* | | MMM | Jan, Feb, ..., Dec | |
|
|
39625
|
-
* | | MMMM | January, February, ..., December | 2 |
|
|
39626
|
-
* | | MMMMM | J, F, ..., D | |
|
|
39627
|
-
* | Month (stand-alone) | L | 1, 2, ..., 12 | |
|
|
39628
|
-
* | | Lo | 1st, 2nd, ..., 12th | 7 |
|
|
39629
|
-
* | | LL | 01, 02, ..., 12 | |
|
|
39630
|
-
* | | LLL | Jan, Feb, ..., Dec | |
|
|
39631
|
-
* | | LLLL | January, February, ..., December | 2 |
|
|
39632
|
-
* | | LLLLL | J, F, ..., D | |
|
|
39633
|
-
* | Local week of year | w | 1, 2, ..., 53 | |
|
|
39634
|
-
* | | wo | 1st, 2nd, ..., 53th | 7 |
|
|
39635
|
-
* | | ww | 01, 02, ..., 53 | |
|
|
39636
|
-
* | ISO week of year | I | 1, 2, ..., 53 | 7 |
|
|
39637
|
-
* | | Io | 1st, 2nd, ..., 53th | 7 |
|
|
39638
|
-
* | | II | 01, 02, ..., 53 | 7 |
|
|
39639
|
-
* | Day of month | d | 1, 2, ..., 31 | |
|
|
39640
|
-
* | | do | 1st, 2nd, ..., 31st | 7 |
|
|
39641
|
-
* | | dd | 01, 02, ..., 31 | |
|
|
39642
|
-
* | Day of year | D | 1, 2, ..., 365, 366 | 9 |
|
|
39643
|
-
* | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
|
|
39644
|
-
* | | DD | 01, 02, ..., 365, 366 | 9 |
|
|
39645
|
-
* | | DDD | 001, 002, ..., 365, 366 | |
|
|
39646
|
-
* | | DDDD | ... | 3 |
|
|
39647
|
-
* | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
|
|
39648
|
-
* | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
|
|
39649
|
-
* | | EEEEE | M, T, W, T, F, S, S | |
|
|
39650
|
-
* | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
39651
|
-
* | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
|
|
39652
|
-
* | | io | 1st, 2nd, ..., 7th | 7 |
|
|
39653
|
-
* | | ii | 01, 02, ..., 07 | 7 |
|
|
39654
|
-
* | | iii | Mon, Tue, Wed, ..., Sun | 7 |
|
|
39655
|
-
* | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
|
|
39656
|
-
* | | iiiii | M, T, W, T, F, S, S | 7 |
|
|
39657
|
-
* | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
|
|
39658
|
-
* | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
|
|
39659
|
-
* | | eo | 2nd, 3rd, ..., 1st | 7 |
|
|
39660
|
-
* | | ee | 02, 03, ..., 01 | |
|
|
39661
|
-
* | | eee | Mon, Tue, Wed, ..., Sun | |
|
|
39662
|
-
* | | eeee | Monday, Tuesday, ..., Sunday | 2 |
|
|
39663
|
-
* | | eeeee | M, T, W, T, F, S, S | |
|
|
39664
|
-
* | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
39665
|
-
* | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
|
|
39666
|
-
* | | co | 2nd, 3rd, ..., 1st | 7 |
|
|
39667
|
-
* | | cc | 02, 03, ..., 01 | |
|
|
39668
|
-
* | | ccc | Mon, Tue, Wed, ..., Sun | |
|
|
39669
|
-
* | | cccc | Monday, Tuesday, ..., Sunday | 2 |
|
|
39670
|
-
* | | ccccc | M, T, W, T, F, S, S | |
|
|
39671
|
-
* | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
|
|
39672
|
-
* | AM, PM | a..aa | AM, PM | |
|
|
39673
|
-
* | | aaa | am, pm | |
|
|
39674
|
-
* | | aaaa | a.m., p.m. | 2 |
|
|
39675
|
-
* | | aaaaa | a, p | |
|
|
39676
|
-
* | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
|
|
39677
|
-
* | | bbb | am, pm, noon, midnight | |
|
|
39678
|
-
* | | bbbb | a.m., p.m., noon, midnight | 2 |
|
|
39679
|
-
* | | bbbbb | a, p, n, mi | |
|
|
39680
|
-
* | Flexible day period | B..BBB | at night, in the morning, ... | |
|
|
39681
|
-
* | | BBBB | at night, in the morning, ... | 2 |
|
|
39682
|
-
* | | BBBBB | at night, in the morning, ... | |
|
|
39683
|
-
* | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
|
|
39684
|
-
* | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
|
|
39685
|
-
* | | hh | 01, 02, ..., 11, 12 | |
|
|
39686
|
-
* | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
|
|
39687
|
-
* | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
|
|
39688
|
-
* | | HH | 00, 01, 02, ..., 23 | |
|
|
39689
|
-
* | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
|
|
39690
|
-
* | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
|
|
39691
|
-
* | | KK | 01, 02, ..., 11, 00 | |
|
|
39692
|
-
* | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
|
|
39693
|
-
* | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
|
|
39694
|
-
* | | kk | 24, 01, 02, ..., 23 | |
|
|
39695
|
-
* | Minute | m | 0, 1, ..., 59 | |
|
|
39696
|
-
* | | mo | 0th, 1st, ..., 59th | 7 |
|
|
39697
|
-
* | | mm | 00, 01, ..., 59 | |
|
|
39698
|
-
* | Second | s | 0, 1, ..., 59 | |
|
|
39699
|
-
* | | so | 0th, 1st, ..., 59th | 7 |
|
|
39700
|
-
* | | ss | 00, 01, ..., 59 | |
|
|
39701
|
-
* | Fraction of second | S | 0, 1, ..., 9 | |
|
|
39702
|
-
* | | SS | 00, 01, ..., 99 | |
|
|
39703
|
-
* | | SSS | 000, 001, ..., 999 | |
|
|
39704
|
-
* | | SSSS | ... | 3 |
|
|
39705
|
-
* | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
|
|
39706
|
-
* | | XX | -0800, +0530, Z | |
|
|
39707
|
-
* | | XXX | -08:00, +05:30, Z | |
|
|
39708
|
-
* | | XXXX | -0800, +0530, Z, +123456 | 2 |
|
|
39709
|
-
* | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
|
|
39710
|
-
* | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
|
|
39711
|
-
* | | xx | -0800, +0530, +0000 | |
|
|
39712
|
-
* | | xxx | -08:00, +05:30, +00:00 | 2 |
|
|
39713
|
-
* | | xxxx | -0800, +0530, +0000, +123456 | |
|
|
39714
|
-
* | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
|
|
39715
|
-
* | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
|
|
39716
|
-
* | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
|
|
39717
|
-
* | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
|
|
39718
|
-
* | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
|
|
39719
|
-
* | Seconds timestamp | t | 512969520 | 7 |
|
|
39720
|
-
* | | tt | ... | 3,7 |
|
|
39721
|
-
* | Milliseconds timestamp | T | 512969520900 | 7 |
|
|
39722
|
-
* | | TT | ... | 3,7 |
|
|
39723
|
-
* | Long localized date | P | 04/29/1453 | 7 |
|
|
39724
|
-
* | | PP | Apr 29, 1453 | 7 |
|
|
39725
|
-
* | | PPP | April 29th, 1453 | 7 |
|
|
39726
|
-
* | | PPPP | Friday, April 29th, 1453 | 2,7 |
|
|
39727
|
-
* | Long localized time | p | 12:00 AM | 7 |
|
|
39728
|
-
* | | pp | 12:00:00 AM | 7 |
|
|
39729
|
-
* | | ppp | 12:00:00 AM GMT+2 | 7 |
|
|
39730
|
-
* | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
|
|
39731
|
-
* | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
|
|
39732
|
-
* | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
|
|
39733
|
-
* | | PPPppp | April 29th, 1453 at ... | 7 |
|
|
39734
|
-
* | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
|
|
39735
|
-
* Notes:
|
|
39736
|
-
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
|
|
39737
|
-
* are the same as "stand-alone" units, but are different in some languages.
|
|
39738
|
-
* "Formatting" units are declined according to the rules of the language
|
|
39739
|
-
* in the context of a date. "Stand-alone" units are always nominative singular:
|
|
39740
|
-
*
|
|
39741
|
-
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
|
|
39742
|
-
*
|
|
39743
|
-
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
|
|
39744
|
-
*
|
|
39745
|
-
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
|
|
39746
|
-
* the single quote characters (see below).
|
|
39747
|
-
* If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
|
|
39748
|
-
* the output will be the same as default pattern for this unit, usually
|
|
39749
|
-
* the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
|
|
39750
|
-
* are marked with "2" in the last column of the table.
|
|
39751
|
-
*
|
|
39752
|
-
* `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
|
|
39753
|
-
*
|
|
39754
|
-
* `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
|
|
39755
|
-
*
|
|
39756
|
-
* `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
|
|
39757
|
-
*
|
|
39758
|
-
* `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
|
|
39759
|
-
*
|
|
39760
|
-
* `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
|
|
39761
|
-
*
|
|
39762
|
-
* 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
|
|
39763
|
-
* The output will be padded with zeros to match the length of the pattern.
|
|
39764
|
-
*
|
|
39765
|
-
* `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
|
|
39766
|
-
*
|
|
39767
|
-
* 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
|
|
39768
|
-
* These tokens represent the shortest form of the quarter.
|
|
39769
|
-
*
|
|
39770
|
-
* 5. The main difference between `y` and `u` patterns are B.C. years:
|
|
39771
|
-
*
|
|
39772
|
-
* | Year | `y` | `u` |
|
|
39773
|
-
* |------|-----|-----|
|
|
39774
|
-
* | AC 1 | 1 | 1 |
|
|
39775
|
-
* | BC 1 | 1 | 0 |
|
|
39776
|
-
* | BC 2 | 2 | -1 |
|
|
39777
|
-
*
|
|
39778
|
-
* Also `yy` always returns the last two digits of a year,
|
|
39779
|
-
* while `uu` pads single digit years to 2 characters and returns other years unchanged:
|
|
39780
|
-
*
|
|
39781
|
-
* | Year | `yy` | `uu` |
|
|
39782
|
-
* |------|------|------|
|
|
39783
|
-
* | 1 | 01 | 01 |
|
|
39784
|
-
* | 14 | 14 | 14 |
|
|
39785
|
-
* | 376 | 76 | 376 |
|
|
39786
|
-
* | 1453 | 53 | 1453 |
|
|
39787
|
-
*
|
|
39788
|
-
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
|
|
39789
|
-
* except local week-numbering years are dependent on `options.weekStartsOn`
|
|
39790
|
-
* and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
|
|
39791
|
-
* and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
|
|
39792
|
-
*
|
|
39793
|
-
* 6. Specific non-location timezones are currently unavailable in `date-fns`,
|
|
39794
|
-
* so right now these tokens fall back to GMT timezones.
|
|
39795
|
-
*
|
|
39796
|
-
* 7. These patterns are not in the Unicode Technical Standard #35:
|
|
39797
|
-
* - `i`: ISO day of week
|
|
39798
|
-
* - `I`: ISO week of year
|
|
39799
|
-
* - `R`: ISO week-numbering year
|
|
39800
|
-
* - `t`: seconds timestamp
|
|
39801
|
-
* - `T`: milliseconds timestamp
|
|
39802
|
-
* - `o`: ordinal number modifier
|
|
39803
|
-
* - `P`: long localized date
|
|
39804
|
-
* - `p`: long localized time
|
|
39805
|
-
*
|
|
39806
|
-
* 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
|
|
39807
|
-
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
39808
|
-
*
|
|
39809
|
-
* 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
|
|
39810
|
-
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
39811
|
-
*
|
|
39812
|
-
* @param date - The original date
|
|
39813
|
-
* @param format - The string of tokens
|
|
39814
|
-
* @param options - An object with options
|
|
39815
|
-
*
|
|
39816
|
-
* @returns The formatted date string
|
|
39817
|
-
*
|
|
39818
|
-
* @throws `date` must not be Invalid Date
|
|
39819
|
-
* @throws `options.locale` must contain `localize` property
|
|
39820
|
-
* @throws `options.locale` must contain `formatLong` property
|
|
39821
|
-
* @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
39822
|
-
* @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
39823
|
-
* @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
39824
|
-
* @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
|
|
39825
|
-
* @throws format string contains an unescaped latin alphabet character
|
|
39826
|
-
*
|
|
39827
|
-
* @example
|
|
39828
|
-
* // Represent 11 February 2014 in middle-endian format:
|
|
39829
|
-
* const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
|
|
39830
|
-
* //=> '02/11/2014'
|
|
39831
|
-
*
|
|
39832
|
-
* @example
|
|
39833
|
-
* // Represent 2 July 2014 in Esperanto:
|
|
39834
|
-
* import { eoLocale } from 'date-fns/locale/eo'
|
|
39835
|
-
* const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
|
|
39836
|
-
* locale: eoLocale
|
|
39837
|
-
* })
|
|
39838
|
-
* //=> '2-a de julio 2014'
|
|
39839
|
-
*
|
|
39840
|
-
* @example
|
|
39841
|
-
* // Escape string by single quote characters:
|
|
39842
|
-
* const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
|
|
39843
|
-
* //=> "3 o'clock"
|
|
39844
|
-
*/
|
|
39845
|
-
function format(date, formatStr, options) {
|
|
39846
|
-
const defaultOptions = (0, _index2.getDefaultOptions)();
|
|
39847
|
-
const locale =
|
|
39848
|
-
options?.locale ?? defaultOptions.locale ?? _index.defaultLocale;
|
|
39849
|
-
|
|
39850
|
-
const firstWeekContainsDate =
|
|
39851
|
-
options?.firstWeekContainsDate ??
|
|
39852
|
-
options?.locale?.options?.firstWeekContainsDate ??
|
|
39853
|
-
defaultOptions.firstWeekContainsDate ??
|
|
39854
|
-
defaultOptions.locale?.options?.firstWeekContainsDate ??
|
|
39855
|
-
1;
|
|
39856
|
-
|
|
39857
|
-
const weekStartsOn =
|
|
39858
|
-
options?.weekStartsOn ??
|
|
39859
|
-
options?.locale?.options?.weekStartsOn ??
|
|
39860
|
-
defaultOptions.weekStartsOn ??
|
|
39861
|
-
defaultOptions.locale?.options?.weekStartsOn ??
|
|
39862
|
-
0;
|
|
39863
|
-
|
|
39864
|
-
const originalDate = (0, _index7.toDate)(date, options?.in);
|
|
39865
|
-
|
|
39866
|
-
if (!(0, _index6.isValid)(originalDate)) {
|
|
39867
|
-
throw new RangeError("Invalid time value");
|
|
39868
|
-
}
|
|
39869
|
-
|
|
39870
|
-
let parts = formatStr
|
|
39871
|
-
.match(longFormattingTokensRegExp)
|
|
39872
|
-
.map((substring) => {
|
|
39873
|
-
const firstCharacter = substring[0];
|
|
39874
|
-
if (firstCharacter === "p" || firstCharacter === "P") {
|
|
39875
|
-
const longFormatter = _index4.longFormatters[firstCharacter];
|
|
39876
|
-
return longFormatter(substring, locale.formatLong);
|
|
39877
|
-
}
|
|
39878
|
-
return substring;
|
|
39879
|
-
})
|
|
39880
|
-
.join("")
|
|
39881
|
-
.match(formattingTokensRegExp)
|
|
39882
|
-
.map((substring) => {
|
|
39883
|
-
// Replace two single quote characters with one single quote character
|
|
39884
|
-
if (substring === "''") {
|
|
39885
|
-
return { isToken: false, value: "'" };
|
|
39886
|
-
}
|
|
39887
|
-
|
|
39888
|
-
const firstCharacter = substring[0];
|
|
39889
|
-
if (firstCharacter === "'") {
|
|
39890
|
-
return { isToken: false, value: cleanEscapedString(substring) };
|
|
39891
|
-
}
|
|
39892
|
-
|
|
39893
|
-
if (_index3.formatters[firstCharacter]) {
|
|
39894
|
-
return { isToken: true, value: substring };
|
|
39895
|
-
}
|
|
39896
|
-
|
|
39897
|
-
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
39898
|
-
throw new RangeError(
|
|
39899
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
39900
|
-
firstCharacter +
|
|
39901
|
-
"`",
|
|
39902
|
-
);
|
|
39903
|
-
}
|
|
39904
|
-
|
|
39905
|
-
return { isToken: false, value: substring };
|
|
39906
|
-
});
|
|
39907
|
-
|
|
39908
|
-
// invoke localize preprocessor (only for french locales at the moment)
|
|
39909
|
-
if (locale.localize.preprocessor) {
|
|
39910
|
-
parts = locale.localize.preprocessor(originalDate, parts);
|
|
39911
|
-
}
|
|
39912
|
-
|
|
39913
|
-
const formatterOptions = {
|
|
39914
|
-
firstWeekContainsDate,
|
|
39915
|
-
weekStartsOn,
|
|
39916
|
-
locale,
|
|
39917
|
-
};
|
|
39918
|
-
|
|
39919
|
-
return parts
|
|
39920
|
-
.map((part) => {
|
|
39921
|
-
if (!part.isToken) return part.value;
|
|
39922
|
-
|
|
39923
|
-
const token = part.value;
|
|
39924
|
-
|
|
39925
|
-
if (
|
|
39926
|
-
(!options?.useAdditionalWeekYearTokens &&
|
|
39927
|
-
(0, _index5.isProtectedWeekYearToken)(token)) ||
|
|
39928
|
-
(!options?.useAdditionalDayOfYearTokens &&
|
|
39929
|
-
(0, _index5.isProtectedDayOfYearToken)(token))
|
|
39930
|
-
) {
|
|
39931
|
-
(0, _index5.warnOrThrowProtectedError)(token, formatStr, String(date));
|
|
39932
|
-
}
|
|
39933
|
-
|
|
39934
|
-
const formatter = _index3.formatters[token[0]];
|
|
39935
|
-
return formatter(originalDate, token, locale.localize, formatterOptions);
|
|
39936
|
-
})
|
|
39937
|
-
.join("");
|
|
39938
|
-
}
|
|
39939
|
-
|
|
39940
|
-
function cleanEscapedString(input) {
|
|
39941
|
-
const matched = input.match(escapedStringRegExp);
|
|
39942
|
-
|
|
39943
|
-
if (!matched) {
|
|
39944
|
-
return input;
|
|
39945
|
-
}
|
|
39946
|
-
|
|
39947
|
-
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
39948
|
-
}
|
|
39949
|
-
|
|
39950
|
-
|
|
39951
|
-
/***/ },
|
|
39952
|
-
|
|
39953
|
-
/***/ "./node_modules/date-fns/getDayOfYear.cjs"
|
|
39954
|
-
/*!************************************************!*\
|
|
39955
|
-
!*** ./node_modules/date-fns/getDayOfYear.cjs ***!
|
|
39956
|
-
\************************************************/
|
|
39957
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
39958
|
-
|
|
39959
|
-
"use strict";
|
|
39960
|
-
|
|
39961
|
-
exports.getDayOfYear = getDayOfYear;
|
|
39962
|
-
var _index = __webpack_require__(/*! ./differenceInCalendarDays.cjs */ "./node_modules/date-fns/differenceInCalendarDays.cjs");
|
|
39963
|
-
var _index2 = __webpack_require__(/*! ./startOfYear.cjs */ "./node_modules/date-fns/startOfYear.cjs");
|
|
39964
|
-
var _index3 = __webpack_require__(/*! ./toDate.cjs */ "./node_modules/date-fns/toDate.cjs");
|
|
39965
|
-
|
|
39966
|
-
/**
|
|
39967
|
-
* The {@link getDayOfYear} function options.
|
|
39968
|
-
*/
|
|
39969
|
-
|
|
39970
|
-
/**
|
|
39971
|
-
* @name getDayOfYear
|
|
39972
|
-
* @category Day Helpers
|
|
39973
|
-
* @summary Get the day of the year of the given date.
|
|
39974
|
-
*
|
|
39975
|
-
* @description
|
|
39976
|
-
* Get the day of the year of the given date.
|
|
39977
|
-
*
|
|
39978
|
-
* @param date - The given date
|
|
39979
|
-
* @param options - The options
|
|
39980
|
-
*
|
|
39981
|
-
* @returns The day of year
|
|
39982
|
-
*
|
|
39983
|
-
* @example
|
|
39984
|
-
* // Which day of the year is 2 July 2014?
|
|
39985
|
-
* const result = getDayOfYear(new Date(2014, 6, 2))
|
|
39986
|
-
* //=> 183
|
|
39987
|
-
*/
|
|
39988
|
-
function getDayOfYear(date, options) {
|
|
39989
|
-
const _date = (0, _index3.toDate)(date, options?.in);
|
|
39990
|
-
const diff = (0, _index.differenceInCalendarDays)(
|
|
39991
|
-
_date,
|
|
39992
|
-
(0, _index2.startOfYear)(_date),
|
|
39993
|
-
);
|
|
39994
|
-
const dayOfYear = diff + 1;
|
|
39995
|
-
return dayOfYear;
|
|
39996
|
-
}
|
|
39997
|
-
|
|
39998
|
-
|
|
39999
|
-
/***/ },
|
|
40000
|
-
|
|
40001
|
-
/***/ "./node_modules/date-fns/getISOWeek.cjs"
|
|
40002
|
-
/*!**********************************************!*\
|
|
40003
|
-
!*** ./node_modules/date-fns/getISOWeek.cjs ***!
|
|
40004
|
-
\**********************************************/
|
|
40005
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
40006
|
-
|
|
40007
|
-
"use strict";
|
|
40008
|
-
|
|
40009
|
-
exports.getISOWeek = getISOWeek;
|
|
40010
|
-
var _index = __webpack_require__(/*! ./constants.cjs */ "./node_modules/date-fns/constants.cjs");
|
|
40011
|
-
var _index2 = __webpack_require__(/*! ./startOfISOWeek.cjs */ "./node_modules/date-fns/startOfISOWeek.cjs");
|
|
40012
|
-
var _index3 = __webpack_require__(/*! ./startOfISOWeekYear.cjs */ "./node_modules/date-fns/startOfISOWeekYear.cjs");
|
|
40013
|
-
var _index4 = __webpack_require__(/*! ./toDate.cjs */ "./node_modules/date-fns/toDate.cjs");
|
|
40014
|
-
|
|
40015
|
-
/**
|
|
40016
|
-
* The {@link getISOWeek} function options.
|
|
40017
|
-
*/
|
|
40018
|
-
|
|
40019
|
-
/**
|
|
40020
|
-
* @name getISOWeek
|
|
40021
|
-
* @category ISO Week Helpers
|
|
40022
|
-
* @summary Get the ISO week of the given date.
|
|
40023
|
-
*
|
|
40024
|
-
* @description
|
|
40025
|
-
* Get the ISO week of the given date.
|
|
40026
|
-
*
|
|
40027
|
-
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
|
40028
|
-
*
|
|
40029
|
-
* @param date - The given date
|
|
40030
|
-
* @param options - The options
|
|
40031
|
-
*
|
|
40032
|
-
* @returns The ISO week
|
|
40033
|
-
*
|
|
40034
|
-
* @example
|
|
40035
|
-
* // Which week of the ISO-week numbering year is 2 January 2005?
|
|
40036
|
-
* const result = getISOWeek(new Date(2005, 0, 2))
|
|
40037
|
-
* //=> 53
|
|
40038
|
-
*/
|
|
40039
|
-
function getISOWeek(date, options) {
|
|
40040
|
-
const _date = (0, _index4.toDate)(date, options?.in);
|
|
40041
|
-
const diff =
|
|
40042
|
-
+(0, _index2.startOfISOWeek)(_date) -
|
|
40043
|
-
+(0, _index3.startOfISOWeekYear)(_date);
|
|
40044
|
-
|
|
40045
|
-
// Round the number of weeks to the nearest integer because the number of
|
|
40046
|
-
// milliseconds in a week is not constant (e.g. it's different in the week of
|
|
40047
|
-
// the daylight saving time clock shift).
|
|
40048
|
-
return Math.round(diff / _index.millisecondsInWeek) + 1;
|
|
40049
|
-
}
|
|
40050
|
-
|
|
40051
|
-
|
|
40052
|
-
/***/ },
|
|
40053
|
-
|
|
40054
|
-
/***/ "./node_modules/date-fns/getISOWeekYear.cjs"
|
|
40055
|
-
/*!**************************************************!*\
|
|
40056
|
-
!*** ./node_modules/date-fns/getISOWeekYear.cjs ***!
|
|
40057
|
-
\**************************************************/
|
|
40058
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
40059
|
-
|
|
40060
|
-
"use strict";
|
|
40061
|
-
|
|
40062
|
-
exports.getISOWeekYear = getISOWeekYear;
|
|
40063
|
-
var _index = __webpack_require__(/*! ./constructFrom.cjs */ "./node_modules/date-fns/constructFrom.cjs");
|
|
40064
|
-
var _index2 = __webpack_require__(/*! ./startOfISOWeek.cjs */ "./node_modules/date-fns/startOfISOWeek.cjs");
|
|
40065
|
-
var _index3 = __webpack_require__(/*! ./toDate.cjs */ "./node_modules/date-fns/toDate.cjs");
|
|
40066
|
-
|
|
40067
|
-
/**
|
|
40068
|
-
* The {@link getISOWeekYear} function options.
|
|
40069
|
-
*/
|
|
40070
|
-
|
|
40071
|
-
/**
|
|
40072
|
-
* @name getISOWeekYear
|
|
40073
|
-
* @category ISO Week-Numbering Year Helpers
|
|
40074
|
-
* @summary Get the ISO week-numbering year of the given date.
|
|
40075
|
-
*
|
|
40076
|
-
* @description
|
|
40077
|
-
* Get the ISO week-numbering year of the given date,
|
|
40078
|
-
* which always starts 3 days before the year's first Thursday.
|
|
40079
|
-
*
|
|
40080
|
-
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
|
40081
|
-
*
|
|
40082
|
-
* @param date - The given date
|
|
40083
|
-
*
|
|
40084
|
-
* @returns The ISO week-numbering year
|
|
40085
|
-
*
|
|
40086
|
-
* @example
|
|
40087
|
-
* // Which ISO-week numbering year is 2 January 2005?
|
|
40088
|
-
* const result = getISOWeekYear(new Date(2005, 0, 2))
|
|
40089
|
-
* //=> 2004
|
|
40090
|
-
*/
|
|
40091
|
-
function getISOWeekYear(date, options) {
|
|
40092
|
-
const _date = (0, _index3.toDate)(date, options?.in);
|
|
40093
|
-
const year = _date.getFullYear();
|
|
40094
|
-
|
|
40095
|
-
const fourthOfJanuaryOfNextYear = (0, _index.constructFrom)(_date, 0);
|
|
40096
|
-
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
|
|
40097
|
-
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
|
|
40098
|
-
const startOfNextYear = (0, _index2.startOfISOWeek)(
|
|
40099
|
-
fourthOfJanuaryOfNextYear,
|
|
40100
|
-
);
|
|
40101
|
-
|
|
40102
|
-
const fourthOfJanuaryOfThisYear = (0, _index.constructFrom)(_date, 0);
|
|
40103
|
-
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
|
|
40104
|
-
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
|
|
40105
|
-
const startOfThisYear = (0, _index2.startOfISOWeek)(
|
|
40106
|
-
fourthOfJanuaryOfThisYear,
|
|
40107
|
-
);
|
|
40108
|
-
|
|
40109
|
-
if (_date.getTime() >= startOfNextYear.getTime()) {
|
|
40110
|
-
return year + 1;
|
|
40111
|
-
} else if (_date.getTime() >= startOfThisYear.getTime()) {
|
|
40112
|
-
return year;
|
|
40113
|
-
} else {
|
|
40114
|
-
return year - 1;
|
|
40115
|
-
}
|
|
40116
|
-
}
|
|
40117
|
-
|
|
40118
|
-
|
|
40119
|
-
/***/ },
|
|
40120
|
-
|
|
40121
|
-
/***/ "./node_modules/date-fns/getWeek.cjs"
|
|
40122
|
-
/*!*******************************************!*\
|
|
40123
|
-
!*** ./node_modules/date-fns/getWeek.cjs ***!
|
|
40124
|
-
\*******************************************/
|
|
40125
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
40126
|
-
|
|
40127
|
-
"use strict";
|
|
40128
|
-
|
|
40129
|
-
exports.getWeek = getWeek;
|
|
40130
|
-
var _index = __webpack_require__(/*! ./constants.cjs */ "./node_modules/date-fns/constants.cjs");
|
|
40131
|
-
var _index2 = __webpack_require__(/*! ./startOfWeek.cjs */ "./node_modules/date-fns/startOfWeek.cjs");
|
|
40132
|
-
var _index3 = __webpack_require__(/*! ./startOfWeekYear.cjs */ "./node_modules/date-fns/startOfWeekYear.cjs");
|
|
40133
|
-
var _index4 = __webpack_require__(/*! ./toDate.cjs */ "./node_modules/date-fns/toDate.cjs");
|
|
40134
|
-
|
|
40135
|
-
/**
|
|
40136
|
-
* The {@link getWeek} function options.
|
|
40137
|
-
*/
|
|
40138
|
-
|
|
40139
|
-
/**
|
|
40140
|
-
* @name getWeek
|
|
40141
|
-
* @category Week Helpers
|
|
40142
|
-
* @summary Get the local week index of the given date.
|
|
40143
|
-
*
|
|
40144
|
-
* @description
|
|
40145
|
-
* Get the local week index of the given date.
|
|
40146
|
-
* The exact calculation depends on the values of
|
|
40147
|
-
* `options.weekStartsOn` (which is the index of the first day of the week)
|
|
40148
|
-
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
|
|
40149
|
-
* the first week of the week-numbering year)
|
|
40150
|
-
*
|
|
40151
|
-
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
|
|
40152
|
-
*
|
|
40153
|
-
* @param date - The given date
|
|
40154
|
-
* @param options - An object with options
|
|
40155
|
-
*
|
|
40156
|
-
* @returns The week
|
|
40157
|
-
*
|
|
40158
|
-
* @example
|
|
40159
|
-
* // Which week of the local week numbering year is 2 January 2005 with default options?
|
|
40160
|
-
* const result = getWeek(new Date(2005, 0, 2))
|
|
40161
|
-
* //=> 2
|
|
40162
|
-
*
|
|
40163
|
-
* @example
|
|
40164
|
-
* // Which week of the local week numbering year is 2 January 2005,
|
|
40165
|
-
* // if Monday is the first day of the week,
|
|
40166
|
-
* // and the first week of the year always contains 4 January?
|
|
40167
|
-
* const result = getWeek(new Date(2005, 0, 2), {
|
|
40168
|
-
* weekStartsOn: 1,
|
|
40169
|
-
* firstWeekContainsDate: 4
|
|
40170
|
-
* })
|
|
40171
|
-
* //=> 53
|
|
40172
|
-
*/
|
|
40173
|
-
function getWeek(date, options) {
|
|
40174
|
-
const _date = (0, _index4.toDate)(date, options?.in);
|
|
40175
|
-
const diff =
|
|
40176
|
-
+(0, _index2.startOfWeek)(_date, options) -
|
|
40177
|
-
+(0, _index3.startOfWeekYear)(_date, options);
|
|
40178
|
-
|
|
40179
|
-
// Round the number of weeks to the nearest integer because the number of
|
|
40180
|
-
// milliseconds in a week is not constant (e.g. it's different in the week of
|
|
40181
|
-
// the daylight saving time clock shift).
|
|
40182
|
-
return Math.round(diff / _index.millisecondsInWeek) + 1;
|
|
40183
|
-
}
|
|
40184
|
-
|
|
40185
|
-
|
|
40186
|
-
/***/ },
|
|
40187
|
-
|
|
40188
|
-
/***/ "./node_modules/date-fns/getWeekYear.cjs"
|
|
40189
|
-
/*!***********************************************!*\
|
|
40190
|
-
!*** ./node_modules/date-fns/getWeekYear.cjs ***!
|
|
40191
|
-
\***********************************************/
|
|
40192
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
40193
|
-
|
|
40194
|
-
"use strict";
|
|
40195
|
-
|
|
40196
|
-
exports.getWeekYear = getWeekYear;
|
|
40197
|
-
var _index = __webpack_require__(/*! ./_lib/defaultOptions.cjs */ "./node_modules/date-fns/_lib/defaultOptions.cjs");
|
|
40198
|
-
var _index2 = __webpack_require__(/*! ./constructFrom.cjs */ "./node_modules/date-fns/constructFrom.cjs");
|
|
40199
|
-
var _index3 = __webpack_require__(/*! ./startOfWeek.cjs */ "./node_modules/date-fns/startOfWeek.cjs");
|
|
40200
|
-
var _index4 = __webpack_require__(/*! ./toDate.cjs */ "./node_modules/date-fns/toDate.cjs");
|
|
40201
|
-
|
|
40202
|
-
/**
|
|
40203
|
-
* The {@link getWeekYear} function options.
|
|
40204
|
-
*/
|
|
40205
|
-
|
|
40206
|
-
/**
|
|
40207
|
-
* @name getWeekYear
|
|
40208
|
-
* @category Week-Numbering Year Helpers
|
|
40209
|
-
* @summary Get the local week-numbering year of the given date.
|
|
40210
|
-
*
|
|
40211
|
-
* @description
|
|
40212
|
-
* Get the local week-numbering year of the given date.
|
|
40213
|
-
* The exact calculation depends on the values of
|
|
40214
|
-
* `options.weekStartsOn` (which is the index of the first day of the week)
|
|
40215
|
-
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
|
|
40216
|
-
* the first week of the week-numbering year)
|
|
40217
|
-
*
|
|
40218
|
-
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
|
|
40219
|
-
*
|
|
40220
|
-
* @param date - The given date
|
|
40221
|
-
* @param options - An object with options.
|
|
40222
|
-
*
|
|
40223
|
-
* @returns The local week-numbering year
|
|
40224
|
-
*
|
|
40225
|
-
* @example
|
|
40226
|
-
* // Which week numbering year is 26 December 2004 with the default settings?
|
|
40227
|
-
* const result = getWeekYear(new Date(2004, 11, 26))
|
|
40228
|
-
* //=> 2005
|
|
40229
|
-
*
|
|
40230
|
-
* @example
|
|
40231
|
-
* // Which week numbering year is 26 December 2004 if week starts on Saturday?
|
|
40232
|
-
* const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
|
|
40233
|
-
* //=> 2004
|
|
40234
|
-
*
|
|
40235
|
-
* @example
|
|
40236
|
-
* // Which week numbering year is 26 December 2004 if the first week contains 4 January?
|
|
40237
|
-
* const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
|
|
40238
|
-
* //=> 2004
|
|
40239
|
-
*/
|
|
40240
|
-
function getWeekYear(date, options) {
|
|
40241
|
-
const _date = (0, _index4.toDate)(date, options?.in);
|
|
40242
|
-
const year = _date.getFullYear();
|
|
40243
|
-
|
|
40244
|
-
const defaultOptions = (0, _index.getDefaultOptions)();
|
|
40245
|
-
const firstWeekContainsDate =
|
|
40246
|
-
options?.firstWeekContainsDate ??
|
|
40247
|
-
options?.locale?.options?.firstWeekContainsDate ??
|
|
40248
|
-
defaultOptions.firstWeekContainsDate ??
|
|
40249
|
-
defaultOptions.locale?.options?.firstWeekContainsDate ??
|
|
40250
|
-
1;
|
|
40251
|
-
|
|
40252
|
-
const firstWeekOfNextYear = (0, _index2.constructFrom)(
|
|
40253
|
-
options?.in || date,
|
|
40254
|
-
0,
|
|
40255
|
-
);
|
|
40256
|
-
firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
|
|
40257
|
-
firstWeekOfNextYear.setHours(0, 0, 0, 0);
|
|
40258
|
-
const startOfNextYear = (0, _index3.startOfWeek)(
|
|
40259
|
-
firstWeekOfNextYear,
|
|
40260
|
-
options,
|
|
40261
|
-
);
|
|
40262
|
-
|
|
40263
|
-
const firstWeekOfThisYear = (0, _index2.constructFrom)(
|
|
40264
|
-
options?.in || date,
|
|
40265
|
-
0,
|
|
40266
|
-
);
|
|
40267
|
-
firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
|
|
40268
|
-
firstWeekOfThisYear.setHours(0, 0, 0, 0);
|
|
40269
|
-
const startOfThisYear = (0, _index3.startOfWeek)(
|
|
40270
|
-
firstWeekOfThisYear,
|
|
40271
|
-
options,
|
|
40272
|
-
);
|
|
40273
|
-
|
|
40274
|
-
if (+_date >= +startOfNextYear) {
|
|
40275
|
-
return year + 1;
|
|
40276
|
-
} else if (+_date >= +startOfThisYear) {
|
|
40277
|
-
return year;
|
|
40278
|
-
} else {
|
|
40279
|
-
return year - 1;
|
|
40280
|
-
}
|
|
40281
|
-
}
|
|
40282
|
-
|
|
40283
|
-
|
|
40284
|
-
/***/ },
|
|
40285
|
-
|
|
40286
|
-
/***/ "./node_modules/date-fns/isDate.cjs"
|
|
40287
|
-
/*!******************************************!*\
|
|
40288
|
-
!*** ./node_modules/date-fns/isDate.cjs ***!
|
|
40289
|
-
\******************************************/
|
|
40290
|
-
(__unused_webpack_module, exports) {
|
|
40291
|
-
|
|
40292
|
-
"use strict";
|
|
40293
|
-
|
|
40294
|
-
exports.isDate = isDate; /**
|
|
40295
|
-
* @name isDate
|
|
40296
|
-
* @category Common Helpers
|
|
40297
|
-
* @summary Is the given value a date?
|
|
40298
|
-
*
|
|
40299
|
-
* @description
|
|
40300
|
-
* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
|
|
40301
|
-
*
|
|
40302
|
-
* @param value - The value to check
|
|
40303
|
-
*
|
|
40304
|
-
* @returns True if the given value is a date
|
|
40305
|
-
*
|
|
40306
|
-
* @example
|
|
40307
|
-
* // For a valid date:
|
|
40308
|
-
* const result = isDate(new Date())
|
|
40309
|
-
* //=> true
|
|
40310
|
-
*
|
|
40311
|
-
* @example
|
|
40312
|
-
* // For an invalid date:
|
|
40313
|
-
* const result = isDate(new Date(NaN))
|
|
40314
|
-
* //=> true
|
|
40315
|
-
*
|
|
40316
|
-
* @example
|
|
40317
|
-
* // For some value:
|
|
40318
|
-
* const result = isDate('2014-02-31')
|
|
40319
|
-
* //=> false
|
|
40320
|
-
*
|
|
40321
|
-
* @example
|
|
40322
|
-
* // For an object:
|
|
40323
|
-
* const result = isDate({})
|
|
40324
|
-
* //=> false
|
|
40325
|
-
*/
|
|
40326
|
-
function isDate(value) {
|
|
40327
|
-
return (
|
|
40328
|
-
value instanceof Date ||
|
|
40329
|
-
(typeof value === "object" &&
|
|
40330
|
-
Object.prototype.toString.call(value) === "[object Date]")
|
|
40331
|
-
);
|
|
40332
|
-
}
|
|
40333
|
-
|
|
40334
|
-
|
|
40335
|
-
/***/ },
|
|
40336
|
-
|
|
40337
|
-
/***/ "./node_modules/date-fns/isValid.cjs"
|
|
40338
|
-
/*!*******************************************!*\
|
|
40339
|
-
!*** ./node_modules/date-fns/isValid.cjs ***!
|
|
40340
|
-
\*******************************************/
|
|
40341
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
40342
|
-
|
|
40343
|
-
"use strict";
|
|
40344
|
-
|
|
40345
|
-
exports.isValid = isValid;
|
|
40346
|
-
var _index = __webpack_require__(/*! ./isDate.cjs */ "./node_modules/date-fns/isDate.cjs");
|
|
40347
|
-
var _index2 = __webpack_require__(/*! ./toDate.cjs */ "./node_modules/date-fns/toDate.cjs");
|
|
40348
|
-
|
|
40349
|
-
/**
|
|
40350
|
-
* @name isValid
|
|
40351
|
-
* @category Common Helpers
|
|
40352
|
-
* @summary Is the given date valid?
|
|
40353
|
-
*
|
|
40354
|
-
* @description
|
|
40355
|
-
* Returns false if argument is Invalid Date and true otherwise.
|
|
40356
|
-
* Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
|
|
40357
|
-
* Invalid Date is a Date, whose time value is NaN.
|
|
40358
|
-
*
|
|
40359
|
-
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
|
40360
|
-
*
|
|
40361
|
-
* @param date - The date to check
|
|
40362
|
-
*
|
|
40363
|
-
* @returns The date is valid
|
|
40364
|
-
*
|
|
40365
|
-
* @example
|
|
40366
|
-
* // For the valid date:
|
|
40367
|
-
* const result = isValid(new Date(2014, 1, 31))
|
|
40368
|
-
* //=> true
|
|
40369
|
-
*
|
|
40370
|
-
* @example
|
|
40371
|
-
* // For the value, convertible into a date:
|
|
40372
|
-
* const result = isValid(1393804800000)
|
|
40373
|
-
* //=> true
|
|
40374
|
-
*
|
|
40375
|
-
* @example
|
|
40376
|
-
* // For the invalid date:
|
|
40377
|
-
* const result = isValid(new Date(''))
|
|
40378
|
-
* //=> false
|
|
40379
|
-
*/
|
|
40380
|
-
function isValid(date) {
|
|
40381
|
-
return !(
|
|
40382
|
-
(!(0, _index.isDate)(date) && typeof date !== "number") ||
|
|
40383
|
-
isNaN(+(0, _index2.toDate)(date))
|
|
40384
|
-
);
|
|
40385
|
-
}
|
|
40386
|
-
|
|
40387
|
-
|
|
40388
|
-
/***/ },
|
|
40389
|
-
|
|
40390
|
-
/***/ "./node_modules/date-fns/locale/_lib/buildFormatLongFn.cjs"
|
|
40391
|
-
/*!*****************************************************************!*\
|
|
40392
|
-
!*** ./node_modules/date-fns/locale/_lib/buildFormatLongFn.cjs ***!
|
|
40393
|
-
\*****************************************************************/
|
|
40394
|
-
(__unused_webpack_module, exports) {
|
|
40395
|
-
|
|
40396
|
-
"use strict";
|
|
40397
|
-
|
|
40398
|
-
exports.buildFormatLongFn = buildFormatLongFn;
|
|
40399
|
-
|
|
40400
|
-
function buildFormatLongFn(args) {
|
|
40401
|
-
return (options = {}) => {
|
|
40402
|
-
// TODO: Remove String()
|
|
40403
|
-
const width = options.width ? String(options.width) : args.defaultWidth;
|
|
40404
|
-
const format = args.formats[width] || args.formats[args.defaultWidth];
|
|
40405
|
-
return format;
|
|
40406
|
-
};
|
|
40407
|
-
}
|
|
40408
|
-
|
|
40409
|
-
|
|
40410
|
-
/***/ },
|
|
40411
|
-
|
|
40412
|
-
/***/ "./node_modules/date-fns/locale/_lib/buildLocalizeFn.cjs"
|
|
40413
|
-
/*!***************************************************************!*\
|
|
40414
|
-
!*** ./node_modules/date-fns/locale/_lib/buildLocalizeFn.cjs ***!
|
|
40415
|
-
\***************************************************************/
|
|
40416
|
-
(__unused_webpack_module, exports) {
|
|
40417
|
-
|
|
40418
|
-
"use strict";
|
|
40419
|
-
|
|
40420
|
-
exports.buildLocalizeFn = buildLocalizeFn;
|
|
40421
|
-
|
|
40422
|
-
/**
|
|
40423
|
-
* The localize function argument callback which allows to convert raw value to
|
|
40424
|
-
* the actual type.
|
|
40425
|
-
*
|
|
40426
|
-
* @param value - The value to convert
|
|
40427
|
-
*
|
|
40428
|
-
* @returns The converted value
|
|
40429
|
-
*/
|
|
40430
|
-
|
|
40431
|
-
/**
|
|
40432
|
-
* The map of localized values for each width.
|
|
40433
|
-
*/
|
|
40434
|
-
|
|
40435
|
-
/**
|
|
40436
|
-
* The index type of the locale unit value. It types conversion of units of
|
|
40437
|
-
* values that don't start at 0 (i.e. quarters).
|
|
40438
|
-
*/
|
|
40439
|
-
|
|
40440
|
-
/**
|
|
40441
|
-
* Converts the unit value to the tuple of values.
|
|
40442
|
-
*/
|
|
40443
|
-
|
|
40444
|
-
/**
|
|
40445
|
-
* The tuple of localized era values. The first element represents BC,
|
|
40446
|
-
* the second element represents AD.
|
|
40447
|
-
*/
|
|
40448
|
-
|
|
40449
|
-
/**
|
|
40450
|
-
* The tuple of localized quarter values. The first element represents Q1.
|
|
40451
|
-
*/
|
|
40452
|
-
|
|
40453
|
-
/**
|
|
40454
|
-
* The tuple of localized day values. The first element represents Sunday.
|
|
40455
|
-
*/
|
|
40456
|
-
|
|
40457
|
-
/**
|
|
40458
|
-
* The tuple of localized month values. The first element represents January.
|
|
40459
|
-
*/
|
|
40460
|
-
|
|
40461
|
-
function buildLocalizeFn(args) {
|
|
40462
|
-
return (value, options) => {
|
|
40463
|
-
const context = options?.context ? String(options.context) : "standalone";
|
|
40464
|
-
|
|
40465
|
-
let valuesArray;
|
|
40466
|
-
if (context === "formatting" && args.formattingValues) {
|
|
40467
|
-
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
40468
|
-
const width = options?.width ? String(options.width) : defaultWidth;
|
|
40469
|
-
|
|
40470
|
-
valuesArray =
|
|
40471
|
-
args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
40472
|
-
} else {
|
|
40473
|
-
const defaultWidth = args.defaultWidth;
|
|
40474
|
-
const width = options?.width ? String(options.width) : args.defaultWidth;
|
|
40475
|
-
|
|
40476
|
-
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
40477
|
-
}
|
|
40478
|
-
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
40479
|
-
|
|
40480
|
-
// @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
|
|
40481
|
-
return valuesArray[index];
|
|
40482
|
-
};
|
|
40483
|
-
}
|
|
40484
|
-
|
|
40485
|
-
|
|
40486
|
-
/***/ },
|
|
40487
|
-
|
|
40488
|
-
/***/ "./node_modules/date-fns/locale/_lib/buildMatchFn.cjs"
|
|
40489
|
-
/*!************************************************************!*\
|
|
40490
|
-
!*** ./node_modules/date-fns/locale/_lib/buildMatchFn.cjs ***!
|
|
40491
|
-
\************************************************************/
|
|
40492
|
-
(__unused_webpack_module, exports) {
|
|
40493
|
-
|
|
40494
|
-
"use strict";
|
|
40495
|
-
|
|
40496
|
-
exports.buildMatchFn = buildMatchFn;
|
|
40497
|
-
|
|
40498
|
-
function buildMatchFn(args) {
|
|
40499
|
-
return (string, options = {}) => {
|
|
40500
|
-
const width = options.width;
|
|
40501
|
-
|
|
40502
|
-
const matchPattern =
|
|
40503
|
-
(width && args.matchPatterns[width]) ||
|
|
40504
|
-
args.matchPatterns[args.defaultMatchWidth];
|
|
40505
|
-
const matchResult = string.match(matchPattern);
|
|
40506
|
-
|
|
40507
|
-
if (!matchResult) {
|
|
40508
|
-
return null;
|
|
40509
|
-
}
|
|
40510
|
-
const matchedString = matchResult[0];
|
|
40511
|
-
|
|
40512
|
-
const parsePatterns =
|
|
40513
|
-
(width && args.parsePatterns[width]) ||
|
|
40514
|
-
args.parsePatterns[args.defaultParseWidth];
|
|
40515
|
-
|
|
40516
|
-
const key = Array.isArray(parsePatterns)
|
|
40517
|
-
? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))
|
|
40518
|
-
: // [TODO] -- I challenge you to fix the type
|
|
40519
|
-
findKey(parsePatterns, (pattern) => pattern.test(matchedString));
|
|
40520
|
-
|
|
40521
|
-
let value;
|
|
40522
|
-
|
|
40523
|
-
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
40524
|
-
value = options.valueCallback
|
|
40525
|
-
? // [TODO] -- I challenge you to fix the type
|
|
40526
|
-
options.valueCallback(value)
|
|
40527
|
-
: value;
|
|
40528
|
-
|
|
40529
|
-
const rest = string.slice(matchedString.length);
|
|
40530
|
-
|
|
40531
|
-
return { value, rest };
|
|
40532
|
-
};
|
|
40533
|
-
}
|
|
40534
|
-
|
|
40535
|
-
function findKey(object, predicate) {
|
|
40536
|
-
for (const key in object) {
|
|
40537
|
-
if (
|
|
40538
|
-
Object.prototype.hasOwnProperty.call(object, key) &&
|
|
40539
|
-
predicate(object[key])
|
|
40540
|
-
) {
|
|
40541
|
-
return key;
|
|
40542
|
-
}
|
|
40543
|
-
}
|
|
40544
|
-
return undefined;
|
|
40545
|
-
}
|
|
40546
|
-
|
|
40547
|
-
function findIndex(array, predicate) {
|
|
40548
|
-
for (let key = 0; key < array.length; key++) {
|
|
40549
|
-
if (predicate(array[key])) {
|
|
40550
|
-
return key;
|
|
40551
|
-
}
|
|
40552
|
-
}
|
|
40553
|
-
return undefined;
|
|
40554
|
-
}
|
|
40555
|
-
|
|
40556
|
-
|
|
40557
|
-
/***/ },
|
|
40558
|
-
|
|
40559
|
-
/***/ "./node_modules/date-fns/locale/_lib/buildMatchPatternFn.cjs"
|
|
40560
|
-
/*!*******************************************************************!*\
|
|
40561
|
-
!*** ./node_modules/date-fns/locale/_lib/buildMatchPatternFn.cjs ***!
|
|
40562
|
-
\*******************************************************************/
|
|
40563
|
-
(__unused_webpack_module, exports) {
|
|
40564
|
-
|
|
40565
|
-
"use strict";
|
|
40566
|
-
|
|
40567
|
-
exports.buildMatchPatternFn = buildMatchPatternFn;
|
|
40568
|
-
|
|
40569
|
-
function buildMatchPatternFn(args) {
|
|
40570
|
-
return (string, options = {}) => {
|
|
40571
|
-
const matchResult = string.match(args.matchPattern);
|
|
40572
|
-
if (!matchResult) return null;
|
|
40573
|
-
const matchedString = matchResult[0];
|
|
40574
|
-
|
|
40575
|
-
const parseResult = string.match(args.parsePattern);
|
|
40576
|
-
if (!parseResult) return null;
|
|
40577
|
-
let value = args.valueCallback
|
|
40578
|
-
? args.valueCallback(parseResult[0])
|
|
40579
|
-
: parseResult[0];
|
|
40580
|
-
|
|
40581
|
-
// [TODO] I challenge you to fix the type
|
|
40582
|
-
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
40583
|
-
|
|
40584
|
-
const rest = string.slice(matchedString.length);
|
|
40585
|
-
|
|
40586
|
-
return { value, rest };
|
|
40587
|
-
};
|
|
40588
|
-
}
|
|
40589
|
-
|
|
40590
|
-
|
|
40591
|
-
/***/ },
|
|
40592
|
-
|
|
40593
|
-
/***/ "./node_modules/date-fns/locale/en-US.cjs"
|
|
40594
|
-
/*!************************************************!*\
|
|
40595
|
-
!*** ./node_modules/date-fns/locale/en-US.cjs ***!
|
|
40596
|
-
\************************************************/
|
|
40597
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
40598
|
-
|
|
40599
|
-
"use strict";
|
|
40600
|
-
|
|
40601
|
-
exports.enUS = void 0;
|
|
40602
|
-
var _index = __webpack_require__(/*! ./en-US/_lib/formatDistance.cjs */ "./node_modules/date-fns/locale/en-US/_lib/formatDistance.cjs");
|
|
40603
|
-
var _index2 = __webpack_require__(/*! ./en-US/_lib/formatLong.cjs */ "./node_modules/date-fns/locale/en-US/_lib/formatLong.cjs");
|
|
40604
|
-
var _index3 = __webpack_require__(/*! ./en-US/_lib/formatRelative.cjs */ "./node_modules/date-fns/locale/en-US/_lib/formatRelative.cjs");
|
|
40605
|
-
var _index4 = __webpack_require__(/*! ./en-US/_lib/localize.cjs */ "./node_modules/date-fns/locale/en-US/_lib/localize.cjs");
|
|
40606
|
-
var _index5 = __webpack_require__(/*! ./en-US/_lib/match.cjs */ "./node_modules/date-fns/locale/en-US/_lib/match.cjs");
|
|
40607
|
-
|
|
40608
|
-
/**
|
|
40609
|
-
* @category Locales
|
|
40610
|
-
* @summary English locale (United States).
|
|
40611
|
-
* @language English
|
|
40612
|
-
* @iso-639-2 eng
|
|
40613
|
-
* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
|
|
40614
|
-
* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
|
|
40615
|
-
*/
|
|
40616
|
-
const enUS = (exports.enUS = {
|
|
40617
|
-
code: "en-US",
|
|
40618
|
-
formatDistance: _index.formatDistance,
|
|
40619
|
-
formatLong: _index2.formatLong,
|
|
40620
|
-
formatRelative: _index3.formatRelative,
|
|
40621
|
-
localize: _index4.localize,
|
|
40622
|
-
match: _index5.match,
|
|
40623
|
-
options: {
|
|
40624
|
-
weekStartsOn: 0 /* Sunday */,
|
|
40625
|
-
firstWeekContainsDate: 1,
|
|
40626
|
-
},
|
|
40627
|
-
});
|
|
40628
|
-
|
|
40629
|
-
|
|
40630
|
-
/***/ },
|
|
40631
|
-
|
|
40632
|
-
/***/ "./node_modules/date-fns/locale/en-US/_lib/formatDistance.cjs"
|
|
40633
|
-
/*!********************************************************************!*\
|
|
40634
|
-
!*** ./node_modules/date-fns/locale/en-US/_lib/formatDistance.cjs ***!
|
|
40635
|
-
\********************************************************************/
|
|
40636
|
-
(__unused_webpack_module, exports) {
|
|
40637
|
-
|
|
40638
|
-
"use strict";
|
|
40639
|
-
|
|
40640
|
-
exports.formatDistance = void 0;
|
|
40641
|
-
|
|
40642
|
-
const formatDistanceLocale = {
|
|
40643
|
-
lessThanXSeconds: {
|
|
40644
|
-
one: "less than a second",
|
|
40645
|
-
other: "less than {{count}} seconds",
|
|
40646
|
-
},
|
|
40647
|
-
|
|
40648
|
-
xSeconds: {
|
|
40649
|
-
one: "1 second",
|
|
40650
|
-
other: "{{count}} seconds",
|
|
40651
|
-
},
|
|
40652
|
-
|
|
40653
|
-
halfAMinute: "half a minute",
|
|
40654
|
-
|
|
40655
|
-
lessThanXMinutes: {
|
|
40656
|
-
one: "less than a minute",
|
|
40657
|
-
other: "less than {{count}} minutes",
|
|
40658
|
-
},
|
|
40659
|
-
|
|
40660
|
-
xMinutes: {
|
|
40661
|
-
one: "1 minute",
|
|
40662
|
-
other: "{{count}} minutes",
|
|
40663
|
-
},
|
|
40664
|
-
|
|
40665
|
-
aboutXHours: {
|
|
40666
|
-
one: "about 1 hour",
|
|
40667
|
-
other: "about {{count}} hours",
|
|
40668
|
-
},
|
|
40669
|
-
|
|
40670
|
-
xHours: {
|
|
40671
|
-
one: "1 hour",
|
|
40672
|
-
other: "{{count}} hours",
|
|
40673
|
-
},
|
|
40674
|
-
|
|
40675
|
-
xDays: {
|
|
40676
|
-
one: "1 day",
|
|
40677
|
-
other: "{{count}} days",
|
|
40678
|
-
},
|
|
40679
|
-
|
|
40680
|
-
aboutXWeeks: {
|
|
40681
|
-
one: "about 1 week",
|
|
40682
|
-
other: "about {{count}} weeks",
|
|
40683
|
-
},
|
|
40684
|
-
|
|
40685
|
-
xWeeks: {
|
|
40686
|
-
one: "1 week",
|
|
40687
|
-
other: "{{count}} weeks",
|
|
40688
|
-
},
|
|
40689
|
-
|
|
40690
|
-
aboutXMonths: {
|
|
40691
|
-
one: "about 1 month",
|
|
40692
|
-
other: "about {{count}} months",
|
|
40693
|
-
},
|
|
40694
|
-
|
|
40695
|
-
xMonths: {
|
|
40696
|
-
one: "1 month",
|
|
40697
|
-
other: "{{count}} months",
|
|
40698
|
-
},
|
|
40699
|
-
|
|
40700
|
-
aboutXYears: {
|
|
40701
|
-
one: "about 1 year",
|
|
40702
|
-
other: "about {{count}} years",
|
|
40703
|
-
},
|
|
40704
|
-
|
|
40705
|
-
xYears: {
|
|
40706
|
-
one: "1 year",
|
|
40707
|
-
other: "{{count}} years",
|
|
40708
|
-
},
|
|
40709
|
-
|
|
40710
|
-
overXYears: {
|
|
40711
|
-
one: "over 1 year",
|
|
40712
|
-
other: "over {{count}} years",
|
|
40713
|
-
},
|
|
40714
|
-
|
|
40715
|
-
almostXYears: {
|
|
40716
|
-
one: "almost 1 year",
|
|
40717
|
-
other: "almost {{count}} years",
|
|
40718
|
-
},
|
|
40719
|
-
};
|
|
40720
|
-
|
|
40721
|
-
const formatDistance = (token, count, options) => {
|
|
40722
|
-
let result;
|
|
40723
|
-
|
|
40724
|
-
const tokenValue = formatDistanceLocale[token];
|
|
40725
|
-
if (typeof tokenValue === "string") {
|
|
40726
|
-
result = tokenValue;
|
|
40727
|
-
} else if (count === 1) {
|
|
40728
|
-
result = tokenValue.one;
|
|
40729
|
-
} else {
|
|
40730
|
-
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
40731
|
-
}
|
|
40732
|
-
|
|
40733
|
-
if (options?.addSuffix) {
|
|
40734
|
-
if (options.comparison && options.comparison > 0) {
|
|
40735
|
-
return "in " + result;
|
|
40736
|
-
} else {
|
|
40737
|
-
return result + " ago";
|
|
40738
|
-
}
|
|
40739
|
-
}
|
|
40740
|
-
|
|
40741
|
-
return result;
|
|
40742
|
-
};
|
|
40743
|
-
exports.formatDistance = formatDistance;
|
|
40744
|
-
|
|
40745
|
-
|
|
40746
|
-
/***/ },
|
|
40747
|
-
|
|
40748
|
-
/***/ "./node_modules/date-fns/locale/en-US/_lib/formatLong.cjs"
|
|
40749
|
-
/*!****************************************************************!*\
|
|
40750
|
-
!*** ./node_modules/date-fns/locale/en-US/_lib/formatLong.cjs ***!
|
|
40751
|
-
\****************************************************************/
|
|
40752
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
40753
|
-
|
|
40754
|
-
"use strict";
|
|
40755
|
-
|
|
40756
|
-
exports.formatLong = void 0;
|
|
40757
|
-
var _index = __webpack_require__(/*! ../../_lib/buildFormatLongFn.cjs */ "./node_modules/date-fns/locale/_lib/buildFormatLongFn.cjs");
|
|
40758
|
-
|
|
40759
|
-
const dateFormats = {
|
|
40760
|
-
full: "EEEE, MMMM do, y",
|
|
40761
|
-
long: "MMMM do, y",
|
|
40762
|
-
medium: "MMM d, y",
|
|
40763
|
-
short: "MM/dd/yyyy",
|
|
40764
|
-
};
|
|
40765
|
-
|
|
40766
|
-
const timeFormats = {
|
|
40767
|
-
full: "h:mm:ss a zzzz",
|
|
40768
|
-
long: "h:mm:ss a z",
|
|
40769
|
-
medium: "h:mm:ss a",
|
|
40770
|
-
short: "h:mm a",
|
|
40771
|
-
};
|
|
40772
|
-
|
|
40773
|
-
const dateTimeFormats = {
|
|
40774
|
-
full: "{{date}} 'at' {{time}}",
|
|
40775
|
-
long: "{{date}} 'at' {{time}}",
|
|
40776
|
-
medium: "{{date}}, {{time}}",
|
|
40777
|
-
short: "{{date}}, {{time}}",
|
|
40778
|
-
};
|
|
40779
|
-
|
|
40780
|
-
const formatLong = (exports.formatLong = {
|
|
40781
|
-
date: (0, _index.buildFormatLongFn)({
|
|
40782
|
-
formats: dateFormats,
|
|
40783
|
-
defaultWidth: "full",
|
|
40784
|
-
}),
|
|
40785
|
-
|
|
40786
|
-
time: (0, _index.buildFormatLongFn)({
|
|
40787
|
-
formats: timeFormats,
|
|
40788
|
-
defaultWidth: "full",
|
|
40789
|
-
}),
|
|
40790
|
-
|
|
40791
|
-
dateTime: (0, _index.buildFormatLongFn)({
|
|
40792
|
-
formats: dateTimeFormats,
|
|
40793
|
-
defaultWidth: "full",
|
|
40794
|
-
}),
|
|
40795
|
-
});
|
|
40796
|
-
|
|
40797
|
-
|
|
40798
|
-
/***/ },
|
|
40799
|
-
|
|
40800
|
-
/***/ "./node_modules/date-fns/locale/en-US/_lib/formatRelative.cjs"
|
|
40801
|
-
/*!********************************************************************!*\
|
|
40802
|
-
!*** ./node_modules/date-fns/locale/en-US/_lib/formatRelative.cjs ***!
|
|
40803
|
-
\********************************************************************/
|
|
40804
|
-
(__unused_webpack_module, exports) {
|
|
40805
|
-
|
|
40806
|
-
"use strict";
|
|
40807
|
-
|
|
40808
|
-
exports.formatRelative = void 0;
|
|
40809
|
-
|
|
40810
|
-
const formatRelativeLocale = {
|
|
40811
|
-
lastWeek: "'last' eeee 'at' p",
|
|
40812
|
-
yesterday: "'yesterday at' p",
|
|
40813
|
-
today: "'today at' p",
|
|
40814
|
-
tomorrow: "'tomorrow at' p",
|
|
40815
|
-
nextWeek: "eeee 'at' p",
|
|
40816
|
-
other: "P",
|
|
40817
|
-
};
|
|
40818
|
-
|
|
40819
|
-
const formatRelative = (token, _date, _baseDate, _options) =>
|
|
40820
|
-
formatRelativeLocale[token];
|
|
40821
|
-
exports.formatRelative = formatRelative;
|
|
40822
|
-
|
|
40823
|
-
|
|
40824
|
-
/***/ },
|
|
40825
|
-
|
|
40826
|
-
/***/ "./node_modules/date-fns/locale/en-US/_lib/localize.cjs"
|
|
40827
|
-
/*!**************************************************************!*\
|
|
40828
|
-
!*** ./node_modules/date-fns/locale/en-US/_lib/localize.cjs ***!
|
|
40829
|
-
\**************************************************************/
|
|
40830
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
40831
|
-
|
|
40832
|
-
"use strict";
|
|
40833
|
-
|
|
40834
|
-
exports.localize = void 0;
|
|
40835
|
-
var _index = __webpack_require__(/*! ../../_lib/buildLocalizeFn.cjs */ "./node_modules/date-fns/locale/_lib/buildLocalizeFn.cjs");
|
|
40836
|
-
|
|
40837
|
-
const eraValues = {
|
|
40838
|
-
narrow: ["B", "A"],
|
|
40839
|
-
abbreviated: ["BC", "AD"],
|
|
40840
|
-
wide: ["Before Christ", "Anno Domini"],
|
|
40841
|
-
};
|
|
40842
|
-
|
|
40843
|
-
const quarterValues = {
|
|
40844
|
-
narrow: ["1", "2", "3", "4"],
|
|
40845
|
-
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
40846
|
-
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
|
|
40847
|
-
};
|
|
40848
|
-
|
|
40849
|
-
// Note: in English, the names of days of the week and months are capitalized.
|
|
40850
|
-
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
|
|
40851
|
-
// Generally, formatted dates should look like they are in the middle of a sentence,
|
|
40852
|
-
// e.g. in Spanish language the weekdays and months should be in the lowercase.
|
|
40853
|
-
const monthValues = {
|
|
40854
|
-
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
40855
|
-
abbreviated: [
|
|
40856
|
-
"Jan",
|
|
40857
|
-
"Feb",
|
|
40858
|
-
"Mar",
|
|
40859
|
-
"Apr",
|
|
40860
|
-
"May",
|
|
40861
|
-
"Jun",
|
|
40862
|
-
"Jul",
|
|
40863
|
-
"Aug",
|
|
40864
|
-
"Sep",
|
|
40865
|
-
"Oct",
|
|
40866
|
-
"Nov",
|
|
40867
|
-
"Dec",
|
|
40868
|
-
],
|
|
40869
|
-
|
|
40870
|
-
wide: [
|
|
40871
|
-
"January",
|
|
40872
|
-
"February",
|
|
40873
|
-
"March",
|
|
40874
|
-
"April",
|
|
40875
|
-
"May",
|
|
40876
|
-
"June",
|
|
40877
|
-
"July",
|
|
40878
|
-
"August",
|
|
40879
|
-
"September",
|
|
40880
|
-
"October",
|
|
40881
|
-
"November",
|
|
40882
|
-
"December",
|
|
40883
|
-
],
|
|
40884
|
-
};
|
|
40885
|
-
|
|
40886
|
-
const dayValues = {
|
|
40887
|
-
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
40888
|
-
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
40889
|
-
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
40890
|
-
wide: [
|
|
40891
|
-
"Sunday",
|
|
40892
|
-
"Monday",
|
|
40893
|
-
"Tuesday",
|
|
40894
|
-
"Wednesday",
|
|
40895
|
-
"Thursday",
|
|
40896
|
-
"Friday",
|
|
40897
|
-
"Saturday",
|
|
40898
|
-
],
|
|
40899
|
-
};
|
|
40900
|
-
|
|
40901
|
-
const dayPeriodValues = {
|
|
40902
|
-
narrow: {
|
|
40903
|
-
am: "a",
|
|
40904
|
-
pm: "p",
|
|
40905
|
-
midnight: "mi",
|
|
40906
|
-
noon: "n",
|
|
40907
|
-
morning: "morning",
|
|
40908
|
-
afternoon: "afternoon",
|
|
40909
|
-
evening: "evening",
|
|
40910
|
-
night: "night",
|
|
40911
|
-
},
|
|
40912
|
-
abbreviated: {
|
|
40913
|
-
am: "AM",
|
|
40914
|
-
pm: "PM",
|
|
40915
|
-
midnight: "midnight",
|
|
40916
|
-
noon: "noon",
|
|
40917
|
-
morning: "morning",
|
|
40918
|
-
afternoon: "afternoon",
|
|
40919
|
-
evening: "evening",
|
|
40920
|
-
night: "night",
|
|
40921
|
-
},
|
|
40922
|
-
wide: {
|
|
40923
|
-
am: "a.m.",
|
|
40924
|
-
pm: "p.m.",
|
|
40925
|
-
midnight: "midnight",
|
|
40926
|
-
noon: "noon",
|
|
40927
|
-
morning: "morning",
|
|
40928
|
-
afternoon: "afternoon",
|
|
40929
|
-
evening: "evening",
|
|
40930
|
-
night: "night",
|
|
40931
|
-
},
|
|
40932
|
-
};
|
|
40933
|
-
|
|
40934
|
-
const formattingDayPeriodValues = {
|
|
40935
|
-
narrow: {
|
|
40936
|
-
am: "a",
|
|
40937
|
-
pm: "p",
|
|
40938
|
-
midnight: "mi",
|
|
40939
|
-
noon: "n",
|
|
40940
|
-
morning: "in the morning",
|
|
40941
|
-
afternoon: "in the afternoon",
|
|
40942
|
-
evening: "in the evening",
|
|
40943
|
-
night: "at night",
|
|
40944
|
-
},
|
|
40945
|
-
abbreviated: {
|
|
40946
|
-
am: "AM",
|
|
40947
|
-
pm: "PM",
|
|
40948
|
-
midnight: "midnight",
|
|
40949
|
-
noon: "noon",
|
|
40950
|
-
morning: "in the morning",
|
|
40951
|
-
afternoon: "in the afternoon",
|
|
40952
|
-
evening: "in the evening",
|
|
40953
|
-
night: "at night",
|
|
40954
|
-
},
|
|
40955
|
-
wide: {
|
|
40956
|
-
am: "a.m.",
|
|
40957
|
-
pm: "p.m.",
|
|
40958
|
-
midnight: "midnight",
|
|
40959
|
-
noon: "noon",
|
|
40960
|
-
morning: "in the morning",
|
|
40961
|
-
afternoon: "in the afternoon",
|
|
40962
|
-
evening: "in the evening",
|
|
40963
|
-
night: "at night",
|
|
40964
|
-
},
|
|
40965
|
-
};
|
|
40966
|
-
|
|
40967
|
-
const ordinalNumber = (dirtyNumber, _options) => {
|
|
40968
|
-
const number = Number(dirtyNumber);
|
|
40969
|
-
|
|
40970
|
-
// If ordinal numbers depend on context, for example,
|
|
40971
|
-
// if they are different for different grammatical genders,
|
|
40972
|
-
// use `options.unit`.
|
|
40973
|
-
//
|
|
40974
|
-
// `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
|
|
40975
|
-
// 'day', 'hour', 'minute', 'second'.
|
|
40976
|
-
|
|
40977
|
-
const rem100 = number % 100;
|
|
40978
|
-
if (rem100 > 20 || rem100 < 10) {
|
|
40979
|
-
switch (rem100 % 10) {
|
|
40980
|
-
case 1:
|
|
40981
|
-
return number + "st";
|
|
40982
|
-
case 2:
|
|
40983
|
-
return number + "nd";
|
|
40984
|
-
case 3:
|
|
40985
|
-
return number + "rd";
|
|
40986
|
-
}
|
|
40987
|
-
}
|
|
40988
|
-
return number + "th";
|
|
40989
|
-
};
|
|
40990
|
-
|
|
40991
|
-
const localize = (exports.localize = {
|
|
40992
|
-
ordinalNumber,
|
|
40993
|
-
|
|
40994
|
-
era: (0, _index.buildLocalizeFn)({
|
|
40995
|
-
values: eraValues,
|
|
40996
|
-
defaultWidth: "wide",
|
|
40997
|
-
}),
|
|
40998
|
-
|
|
40999
|
-
quarter: (0, _index.buildLocalizeFn)({
|
|
41000
|
-
values: quarterValues,
|
|
41001
|
-
defaultWidth: "wide",
|
|
41002
|
-
argumentCallback: (quarter) => quarter - 1,
|
|
41003
|
-
}),
|
|
41004
|
-
|
|
41005
|
-
month: (0, _index.buildLocalizeFn)({
|
|
41006
|
-
values: monthValues,
|
|
41007
|
-
defaultWidth: "wide",
|
|
41008
|
-
}),
|
|
41009
|
-
|
|
41010
|
-
day: (0, _index.buildLocalizeFn)({
|
|
41011
|
-
values: dayValues,
|
|
41012
|
-
defaultWidth: "wide",
|
|
41013
|
-
}),
|
|
41014
|
-
|
|
41015
|
-
dayPeriod: (0, _index.buildLocalizeFn)({
|
|
41016
|
-
values: dayPeriodValues,
|
|
41017
|
-
defaultWidth: "wide",
|
|
41018
|
-
formattingValues: formattingDayPeriodValues,
|
|
41019
|
-
defaultFormattingWidth: "wide",
|
|
41020
|
-
}),
|
|
41021
|
-
});
|
|
41022
|
-
|
|
41023
|
-
|
|
41024
|
-
/***/ },
|
|
41025
|
-
|
|
41026
|
-
/***/ "./node_modules/date-fns/locale/en-US/_lib/match.cjs"
|
|
41027
|
-
/*!***********************************************************!*\
|
|
41028
|
-
!*** ./node_modules/date-fns/locale/en-US/_lib/match.cjs ***!
|
|
41029
|
-
\***********************************************************/
|
|
41030
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
41031
|
-
|
|
41032
|
-
"use strict";
|
|
41033
|
-
|
|
41034
|
-
exports.match = void 0;
|
|
41035
|
-
|
|
41036
|
-
var _index = __webpack_require__(/*! ../../_lib/buildMatchFn.cjs */ "./node_modules/date-fns/locale/_lib/buildMatchFn.cjs");
|
|
41037
|
-
var _index2 = __webpack_require__(/*! ../../_lib/buildMatchPatternFn.cjs */ "./node_modules/date-fns/locale/_lib/buildMatchPatternFn.cjs");
|
|
41038
|
-
|
|
41039
|
-
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
|
41040
|
-
const parseOrdinalNumberPattern = /\d+/i;
|
|
41041
|
-
|
|
41042
|
-
const matchEraPatterns = {
|
|
41043
|
-
narrow: /^(b|a)/i,
|
|
41044
|
-
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
41045
|
-
wide: /^(before christ|before common era|anno domini|common era)/i,
|
|
41046
|
-
};
|
|
41047
|
-
const parseEraPatterns = {
|
|
41048
|
-
any: [/^b/i, /^(a|c)/i],
|
|
41049
|
-
};
|
|
41050
|
-
|
|
41051
|
-
const matchQuarterPatterns = {
|
|
41052
|
-
narrow: /^[1234]/i,
|
|
41053
|
-
abbreviated: /^q[1234]/i,
|
|
41054
|
-
wide: /^[1234](th|st|nd|rd)? quarter/i,
|
|
41055
|
-
};
|
|
41056
|
-
const parseQuarterPatterns = {
|
|
41057
|
-
any: [/1/i, /2/i, /3/i, /4/i],
|
|
41058
|
-
};
|
|
41059
|
-
|
|
41060
|
-
const matchMonthPatterns = {
|
|
41061
|
-
narrow: /^[jfmasond]/i,
|
|
41062
|
-
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
41063
|
-
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
|
|
41064
|
-
};
|
|
41065
|
-
const parseMonthPatterns = {
|
|
41066
|
-
narrow: [
|
|
41067
|
-
/^j/i,
|
|
41068
|
-
/^f/i,
|
|
41069
|
-
/^m/i,
|
|
41070
|
-
/^a/i,
|
|
41071
|
-
/^m/i,
|
|
41072
|
-
/^j/i,
|
|
41073
|
-
/^j/i,
|
|
41074
|
-
/^a/i,
|
|
41075
|
-
/^s/i,
|
|
41076
|
-
/^o/i,
|
|
41077
|
-
/^n/i,
|
|
41078
|
-
/^d/i,
|
|
41079
|
-
],
|
|
41080
|
-
|
|
41081
|
-
any: [
|
|
41082
|
-
/^ja/i,
|
|
41083
|
-
/^f/i,
|
|
41084
|
-
/^mar/i,
|
|
41085
|
-
/^ap/i,
|
|
41086
|
-
/^may/i,
|
|
41087
|
-
/^jun/i,
|
|
41088
|
-
/^jul/i,
|
|
41089
|
-
/^au/i,
|
|
41090
|
-
/^s/i,
|
|
41091
|
-
/^o/i,
|
|
41092
|
-
/^n/i,
|
|
41093
|
-
/^d/i,
|
|
41094
|
-
],
|
|
41095
|
-
};
|
|
41096
|
-
|
|
41097
|
-
const matchDayPatterns = {
|
|
41098
|
-
narrow: /^[smtwf]/i,
|
|
41099
|
-
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
41100
|
-
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
41101
|
-
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
|
|
41102
|
-
};
|
|
41103
|
-
const parseDayPatterns = {
|
|
41104
|
-
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
41105
|
-
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
|
|
41106
|
-
};
|
|
41107
|
-
|
|
41108
|
-
const matchDayPeriodPatterns = {
|
|
41109
|
-
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
41110
|
-
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
|
|
41111
|
-
};
|
|
41112
|
-
const parseDayPeriodPatterns = {
|
|
41113
|
-
any: {
|
|
41114
|
-
am: /^a/i,
|
|
41115
|
-
pm: /^p/i,
|
|
41116
|
-
midnight: /^mi/i,
|
|
41117
|
-
noon: /^no/i,
|
|
41118
|
-
morning: /morning/i,
|
|
41119
|
-
afternoon: /afternoon/i,
|
|
41120
|
-
evening: /evening/i,
|
|
41121
|
-
night: /night/i,
|
|
41122
|
-
},
|
|
41123
|
-
};
|
|
41124
|
-
|
|
41125
|
-
const match = (exports.match = {
|
|
41126
|
-
ordinalNumber: (0, _index2.buildMatchPatternFn)({
|
|
41127
|
-
matchPattern: matchOrdinalNumberPattern,
|
|
41128
|
-
parsePattern: parseOrdinalNumberPattern,
|
|
41129
|
-
valueCallback: (value) => parseInt(value, 10),
|
|
41130
|
-
}),
|
|
41131
|
-
|
|
41132
|
-
era: (0, _index.buildMatchFn)({
|
|
41133
|
-
matchPatterns: matchEraPatterns,
|
|
41134
|
-
defaultMatchWidth: "wide",
|
|
41135
|
-
parsePatterns: parseEraPatterns,
|
|
41136
|
-
defaultParseWidth: "any",
|
|
41137
|
-
}),
|
|
41138
|
-
|
|
41139
|
-
quarter: (0, _index.buildMatchFn)({
|
|
41140
|
-
matchPatterns: matchQuarterPatterns,
|
|
41141
|
-
defaultMatchWidth: "wide",
|
|
41142
|
-
parsePatterns: parseQuarterPatterns,
|
|
41143
|
-
defaultParseWidth: "any",
|
|
41144
|
-
valueCallback: (index) => index + 1,
|
|
41145
|
-
}),
|
|
41146
|
-
|
|
41147
|
-
month: (0, _index.buildMatchFn)({
|
|
41148
|
-
matchPatterns: matchMonthPatterns,
|
|
41149
|
-
defaultMatchWidth: "wide",
|
|
41150
|
-
parsePatterns: parseMonthPatterns,
|
|
41151
|
-
defaultParseWidth: "any",
|
|
41152
|
-
}),
|
|
41153
|
-
|
|
41154
|
-
day: (0, _index.buildMatchFn)({
|
|
41155
|
-
matchPatterns: matchDayPatterns,
|
|
41156
|
-
defaultMatchWidth: "wide",
|
|
41157
|
-
parsePatterns: parseDayPatterns,
|
|
41158
|
-
defaultParseWidth: "any",
|
|
41159
|
-
}),
|
|
41160
|
-
|
|
41161
|
-
dayPeriod: (0, _index.buildMatchFn)({
|
|
41162
|
-
matchPatterns: matchDayPeriodPatterns,
|
|
41163
|
-
defaultMatchWidth: "any",
|
|
41164
|
-
parsePatterns: parseDayPeriodPatterns,
|
|
41165
|
-
defaultParseWidth: "any",
|
|
41166
|
-
}),
|
|
41167
|
-
});
|
|
41168
|
-
|
|
41169
|
-
|
|
41170
|
-
/***/ },
|
|
41171
|
-
|
|
41172
|
-
/***/ "./node_modules/date-fns/startOfDay.cjs"
|
|
41173
|
-
/*!**********************************************!*\
|
|
41174
|
-
!*** ./node_modules/date-fns/startOfDay.cjs ***!
|
|
41175
|
-
\**********************************************/
|
|
41176
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
41177
|
-
|
|
41178
|
-
"use strict";
|
|
41179
|
-
|
|
41180
|
-
exports.startOfDay = startOfDay;
|
|
41181
|
-
var _index = __webpack_require__(/*! ./toDate.cjs */ "./node_modules/date-fns/toDate.cjs");
|
|
41182
|
-
|
|
41183
|
-
/**
|
|
41184
|
-
* The {@link startOfDay} function options.
|
|
41185
|
-
*/
|
|
41186
|
-
|
|
41187
|
-
/**
|
|
41188
|
-
* @name startOfDay
|
|
41189
|
-
* @category Day Helpers
|
|
41190
|
-
* @summary Return the start of a day for the given date.
|
|
41191
|
-
*
|
|
41192
|
-
* @description
|
|
41193
|
-
* Return the start of a day for the given date.
|
|
41194
|
-
* The result will be in the local timezone.
|
|
41195
|
-
*
|
|
41196
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
41197
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
41198
|
-
*
|
|
41199
|
-
* @param date - The original date
|
|
41200
|
-
* @param options - The options
|
|
41201
|
-
*
|
|
41202
|
-
* @returns The start of a day
|
|
41203
|
-
*
|
|
41204
|
-
* @example
|
|
41205
|
-
* // The start of a day for 2 September 2014 11:55:00:
|
|
41206
|
-
* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
|
|
41207
|
-
* //=> Tue Sep 02 2014 00:00:00
|
|
41208
|
-
*/
|
|
41209
|
-
function startOfDay(date, options) {
|
|
41210
|
-
const _date = (0, _index.toDate)(date, options?.in);
|
|
41211
|
-
_date.setHours(0, 0, 0, 0);
|
|
41212
|
-
return _date;
|
|
41213
|
-
}
|
|
41214
|
-
|
|
41215
|
-
|
|
41216
|
-
/***/ },
|
|
41217
|
-
|
|
41218
|
-
/***/ "./node_modules/date-fns/startOfISOWeek.cjs"
|
|
41219
|
-
/*!**************************************************!*\
|
|
41220
|
-
!*** ./node_modules/date-fns/startOfISOWeek.cjs ***!
|
|
41221
|
-
\**************************************************/
|
|
41222
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
41223
|
-
|
|
41224
|
-
"use strict";
|
|
41225
|
-
|
|
41226
|
-
exports.startOfISOWeek = startOfISOWeek;
|
|
41227
|
-
var _index = __webpack_require__(/*! ./startOfWeek.cjs */ "./node_modules/date-fns/startOfWeek.cjs");
|
|
41228
|
-
|
|
41229
|
-
/**
|
|
41230
|
-
* The {@link startOfISOWeek} function options.
|
|
41231
|
-
*/
|
|
41232
|
-
|
|
41233
|
-
/**
|
|
41234
|
-
* @name startOfISOWeek
|
|
41235
|
-
* @category ISO Week Helpers
|
|
41236
|
-
* @summary Return the start of an ISO week for the given date.
|
|
41237
|
-
*
|
|
41238
|
-
* @description
|
|
41239
|
-
* Return the start of an ISO week for the given date.
|
|
41240
|
-
* The result will be in the local timezone.
|
|
41241
|
-
*
|
|
41242
|
-
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
|
41243
|
-
*
|
|
41244
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
41245
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
41246
|
-
*
|
|
41247
|
-
* @param date - The original date
|
|
41248
|
-
* @param options - An object with options
|
|
41249
|
-
*
|
|
41250
|
-
* @returns The start of an ISO week
|
|
41251
|
-
*
|
|
41252
|
-
* @example
|
|
41253
|
-
* // The start of an ISO week for 2 September 2014 11:55:00:
|
|
41254
|
-
* const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
|
|
41255
|
-
* //=> Mon Sep 01 2014 00:00:00
|
|
41256
|
-
*/
|
|
41257
|
-
function startOfISOWeek(date, options) {
|
|
41258
|
-
return (0, _index.startOfWeek)(date, { ...options, weekStartsOn: 1 });
|
|
41259
|
-
}
|
|
41260
|
-
|
|
41261
|
-
|
|
41262
|
-
/***/ },
|
|
41263
|
-
|
|
41264
|
-
/***/ "./node_modules/date-fns/startOfISOWeekYear.cjs"
|
|
41265
|
-
/*!******************************************************!*\
|
|
41266
|
-
!*** ./node_modules/date-fns/startOfISOWeekYear.cjs ***!
|
|
41267
|
-
\******************************************************/
|
|
41268
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
41269
|
-
|
|
41270
|
-
"use strict";
|
|
41271
|
-
|
|
41272
|
-
exports.startOfISOWeekYear = startOfISOWeekYear;
|
|
41273
|
-
var _index = __webpack_require__(/*! ./constructFrom.cjs */ "./node_modules/date-fns/constructFrom.cjs");
|
|
41274
|
-
var _index2 = __webpack_require__(/*! ./getISOWeekYear.cjs */ "./node_modules/date-fns/getISOWeekYear.cjs");
|
|
41275
|
-
var _index3 = __webpack_require__(/*! ./startOfISOWeek.cjs */ "./node_modules/date-fns/startOfISOWeek.cjs");
|
|
41276
|
-
|
|
41277
|
-
/**
|
|
41278
|
-
* The {@link startOfISOWeekYear} function options.
|
|
41279
|
-
*/
|
|
41280
|
-
|
|
41281
|
-
/**
|
|
41282
|
-
* @name startOfISOWeekYear
|
|
41283
|
-
* @category ISO Week-Numbering Year Helpers
|
|
41284
|
-
* @summary Return the start of an ISO week-numbering year for the given date.
|
|
41285
|
-
*
|
|
41286
|
-
* @description
|
|
41287
|
-
* Return the start of an ISO week-numbering year,
|
|
41288
|
-
* which always starts 3 days before the year's first Thursday.
|
|
41289
|
-
* The result will be in the local timezone.
|
|
41290
|
-
*
|
|
41291
|
-
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
|
|
41292
|
-
*
|
|
41293
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
41294
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
41295
|
-
*
|
|
41296
|
-
* @param date - The original date
|
|
41297
|
-
* @param options - An object with options
|
|
41298
|
-
*
|
|
41299
|
-
* @returns The start of an ISO week-numbering year
|
|
41300
|
-
*
|
|
41301
|
-
* @example
|
|
41302
|
-
* // The start of an ISO week-numbering year for 2 July 2005:
|
|
41303
|
-
* const result = startOfISOWeekYear(new Date(2005, 6, 2))
|
|
41304
|
-
* //=> Mon Jan 03 2005 00:00:00
|
|
41305
|
-
*/
|
|
41306
|
-
function startOfISOWeekYear(date, options) {
|
|
41307
|
-
const year = (0, _index2.getISOWeekYear)(date, options);
|
|
41308
|
-
const fourthOfJanuary = (0, _index.constructFrom)(options?.in || date, 0);
|
|
41309
|
-
fourthOfJanuary.setFullYear(year, 0, 4);
|
|
41310
|
-
fourthOfJanuary.setHours(0, 0, 0, 0);
|
|
41311
|
-
return (0, _index3.startOfISOWeek)(fourthOfJanuary);
|
|
41312
|
-
}
|
|
41313
|
-
|
|
41314
|
-
|
|
41315
|
-
/***/ },
|
|
41316
|
-
|
|
41317
|
-
/***/ "./node_modules/date-fns/startOfWeek.cjs"
|
|
41318
|
-
/*!***********************************************!*\
|
|
41319
|
-
!*** ./node_modules/date-fns/startOfWeek.cjs ***!
|
|
41320
|
-
\***********************************************/
|
|
41321
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
41322
|
-
|
|
41323
|
-
"use strict";
|
|
41324
|
-
|
|
41325
|
-
exports.startOfWeek = startOfWeek;
|
|
41326
|
-
var _index = __webpack_require__(/*! ./_lib/defaultOptions.cjs */ "./node_modules/date-fns/_lib/defaultOptions.cjs");
|
|
41327
|
-
var _index2 = __webpack_require__(/*! ./toDate.cjs */ "./node_modules/date-fns/toDate.cjs");
|
|
41328
|
-
|
|
41329
|
-
/**
|
|
41330
|
-
* The {@link startOfWeek} function options.
|
|
41331
|
-
*/
|
|
41332
|
-
|
|
41333
|
-
/**
|
|
41334
|
-
* @name startOfWeek
|
|
41335
|
-
* @category Week Helpers
|
|
41336
|
-
* @summary Return the start of a week for the given date.
|
|
41337
|
-
*
|
|
41338
|
-
* @description
|
|
41339
|
-
* Return the start of a week for the given date.
|
|
41340
|
-
* The result will be in the local timezone.
|
|
41341
|
-
*
|
|
41342
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
41343
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
41344
|
-
*
|
|
41345
|
-
* @param date - The original date
|
|
41346
|
-
* @param options - An object with options
|
|
41347
|
-
*
|
|
41348
|
-
* @returns The start of a week
|
|
41349
|
-
*
|
|
41350
|
-
* @example
|
|
41351
|
-
* // The start of a week for 2 September 2014 11:55:00:
|
|
41352
|
-
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
|
|
41353
|
-
* //=> Sun Aug 31 2014 00:00:00
|
|
41354
|
-
*
|
|
41355
|
-
* @example
|
|
41356
|
-
* // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
|
|
41357
|
-
* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
|
|
41358
|
-
* //=> Mon Sep 01 2014 00:00:00
|
|
41359
|
-
*/
|
|
41360
|
-
function startOfWeek(date, options) {
|
|
41361
|
-
const defaultOptions = (0, _index.getDefaultOptions)();
|
|
41362
|
-
const weekStartsOn =
|
|
41363
|
-
options?.weekStartsOn ??
|
|
41364
|
-
options?.locale?.options?.weekStartsOn ??
|
|
41365
|
-
defaultOptions.weekStartsOn ??
|
|
41366
|
-
defaultOptions.locale?.options?.weekStartsOn ??
|
|
41367
|
-
0;
|
|
41368
|
-
|
|
41369
|
-
const _date = (0, _index2.toDate)(date, options?.in);
|
|
41370
|
-
const day = _date.getDay();
|
|
41371
|
-
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
41372
|
-
|
|
41373
|
-
_date.setDate(_date.getDate() - diff);
|
|
41374
|
-
_date.setHours(0, 0, 0, 0);
|
|
41375
|
-
return _date;
|
|
41376
|
-
}
|
|
41377
|
-
|
|
41378
|
-
|
|
41379
|
-
/***/ },
|
|
41380
|
-
|
|
41381
|
-
/***/ "./node_modules/date-fns/startOfWeekYear.cjs"
|
|
41382
|
-
/*!***************************************************!*\
|
|
41383
|
-
!*** ./node_modules/date-fns/startOfWeekYear.cjs ***!
|
|
41384
|
-
\***************************************************/
|
|
41385
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
41386
|
-
|
|
41387
|
-
"use strict";
|
|
41388
|
-
|
|
41389
|
-
exports.startOfWeekYear = startOfWeekYear;
|
|
41390
|
-
var _index = __webpack_require__(/*! ./_lib/defaultOptions.cjs */ "./node_modules/date-fns/_lib/defaultOptions.cjs");
|
|
41391
|
-
var _index2 = __webpack_require__(/*! ./constructFrom.cjs */ "./node_modules/date-fns/constructFrom.cjs");
|
|
41392
|
-
var _index3 = __webpack_require__(/*! ./getWeekYear.cjs */ "./node_modules/date-fns/getWeekYear.cjs");
|
|
41393
|
-
var _index4 = __webpack_require__(/*! ./startOfWeek.cjs */ "./node_modules/date-fns/startOfWeek.cjs");
|
|
41394
|
-
|
|
41395
|
-
/**
|
|
41396
|
-
* The {@link startOfWeekYear} function options.
|
|
41397
|
-
*/
|
|
41398
|
-
|
|
41399
|
-
/**
|
|
41400
|
-
* @name startOfWeekYear
|
|
41401
|
-
* @category Week-Numbering Year Helpers
|
|
41402
|
-
* @summary Return the start of a local week-numbering year for the given date.
|
|
41403
|
-
*
|
|
41404
|
-
* @description
|
|
41405
|
-
* Return the start of a local week-numbering year.
|
|
41406
|
-
* The exact calculation depends on the values of
|
|
41407
|
-
* `options.weekStartsOn` (which is the index of the first day of the week)
|
|
41408
|
-
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
|
|
41409
|
-
* the first week of the week-numbering year)
|
|
41410
|
-
*
|
|
41411
|
-
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
|
|
41412
|
-
*
|
|
41413
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
41414
|
-
* @typeParam ResultDate - The result `Date` type.
|
|
41415
|
-
*
|
|
41416
|
-
* @param date - The original date
|
|
41417
|
-
* @param options - An object with options
|
|
41418
|
-
*
|
|
41419
|
-
* @returns The start of a week-numbering year
|
|
41420
|
-
*
|
|
41421
|
-
* @example
|
|
41422
|
-
* // The start of an a week-numbering year for 2 July 2005 with default settings:
|
|
41423
|
-
* const result = startOfWeekYear(new Date(2005, 6, 2))
|
|
41424
|
-
* //=> Sun Dec 26 2004 00:00:00
|
|
41425
|
-
*
|
|
41426
|
-
* @example
|
|
41427
|
-
* // The start of a week-numbering year for 2 July 2005
|
|
41428
|
-
* // if Monday is the first day of week
|
|
41429
|
-
* // and 4 January is always in the first week of the year:
|
|
41430
|
-
* const result = startOfWeekYear(new Date(2005, 6, 2), {
|
|
41431
|
-
* weekStartsOn: 1,
|
|
41432
|
-
* firstWeekContainsDate: 4
|
|
41433
|
-
* })
|
|
41434
|
-
* //=> Mon Jan 03 2005 00:00:00
|
|
41435
|
-
*/
|
|
41436
|
-
function startOfWeekYear(date, options) {
|
|
41437
|
-
const defaultOptions = (0, _index.getDefaultOptions)();
|
|
41438
|
-
const firstWeekContainsDate =
|
|
41439
|
-
options?.firstWeekContainsDate ??
|
|
41440
|
-
options?.locale?.options?.firstWeekContainsDate ??
|
|
41441
|
-
defaultOptions.firstWeekContainsDate ??
|
|
41442
|
-
defaultOptions.locale?.options?.firstWeekContainsDate ??
|
|
41443
|
-
1;
|
|
41444
|
-
|
|
41445
|
-
const year = (0, _index3.getWeekYear)(date, options);
|
|
41446
|
-
const firstWeek = (0, _index2.constructFrom)(options?.in || date, 0);
|
|
41447
|
-
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
|
|
41448
|
-
firstWeek.setHours(0, 0, 0, 0);
|
|
41449
|
-
const _date = (0, _index4.startOfWeek)(firstWeek, options);
|
|
41450
|
-
return _date;
|
|
41451
|
-
}
|
|
41452
|
-
|
|
41453
|
-
|
|
41454
|
-
/***/ },
|
|
41455
|
-
|
|
41456
|
-
/***/ "./node_modules/date-fns/startOfYear.cjs"
|
|
41457
|
-
/*!***********************************************!*\
|
|
41458
|
-
!*** ./node_modules/date-fns/startOfYear.cjs ***!
|
|
41459
|
-
\***********************************************/
|
|
41460
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
41461
|
-
|
|
41462
|
-
"use strict";
|
|
41463
|
-
|
|
41464
|
-
exports.startOfYear = startOfYear;
|
|
41465
|
-
var _index = __webpack_require__(/*! ./toDate.cjs */ "./node_modules/date-fns/toDate.cjs");
|
|
41466
|
-
|
|
41467
|
-
/**
|
|
41468
|
-
* The {@link startOfYear} function options.
|
|
41469
|
-
*/
|
|
41470
|
-
|
|
41471
|
-
/**
|
|
41472
|
-
* @name startOfYear
|
|
41473
|
-
* @category Year Helpers
|
|
41474
|
-
* @summary Return the start of a year for the given date.
|
|
41475
|
-
*
|
|
41476
|
-
* @description
|
|
41477
|
-
* Return the start of a year for the given date.
|
|
41478
|
-
* The result will be in the local timezone.
|
|
41479
|
-
*
|
|
41480
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
41481
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
41482
|
-
*
|
|
41483
|
-
* @param date - The original date
|
|
41484
|
-
* @param options - The options
|
|
41485
|
-
*
|
|
41486
|
-
* @returns The start of a year
|
|
41487
|
-
*
|
|
41488
|
-
* @example
|
|
41489
|
-
* // The start of a year for 2 September 2014 11:55:00:
|
|
41490
|
-
* const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
|
|
41491
|
-
* //=> Wed Jan 01 2014 00:00:00
|
|
41492
|
-
*/
|
|
41493
|
-
function startOfYear(date, options) {
|
|
41494
|
-
const date_ = (0, _index.toDate)(date, options?.in);
|
|
41495
|
-
date_.setFullYear(date_.getFullYear(), 0, 1);
|
|
41496
|
-
date_.setHours(0, 0, 0, 0);
|
|
41497
|
-
return date_;
|
|
41498
|
-
}
|
|
41499
|
-
|
|
41500
|
-
|
|
41501
|
-
/***/ },
|
|
41502
|
-
|
|
41503
|
-
/***/ "./node_modules/date-fns/toDate.cjs"
|
|
41504
|
-
/*!******************************************!*\
|
|
41505
|
-
!*** ./node_modules/date-fns/toDate.cjs ***!
|
|
41506
|
-
\******************************************/
|
|
41507
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
41508
|
-
|
|
41509
|
-
"use strict";
|
|
41510
|
-
|
|
41511
|
-
exports.toDate = toDate;
|
|
41512
|
-
var _index = __webpack_require__(/*! ./constructFrom.cjs */ "./node_modules/date-fns/constructFrom.cjs");
|
|
41513
|
-
|
|
41514
|
-
/**
|
|
41515
|
-
* @name toDate
|
|
41516
|
-
* @category Common Helpers
|
|
41517
|
-
* @summary Convert the given argument to an instance of Date.
|
|
41518
|
-
*
|
|
41519
|
-
* @description
|
|
41520
|
-
* Convert the given argument to an instance of Date.
|
|
41521
|
-
*
|
|
41522
|
-
* If the argument is an instance of Date, the function returns its clone.
|
|
41523
|
-
*
|
|
41524
|
-
* If the argument is a number, it is treated as a timestamp.
|
|
41525
|
-
*
|
|
41526
|
-
* If the argument is none of the above, the function returns Invalid Date.
|
|
41527
|
-
*
|
|
41528
|
-
* Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
|
|
41529
|
-
* enabling to transfer extra properties from the reference date to the new date.
|
|
41530
|
-
* It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
|
|
41531
|
-
* that accept a time zone as a constructor argument.
|
|
41532
|
-
*
|
|
41533
|
-
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
41534
|
-
*
|
|
41535
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
41536
|
-
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
41537
|
-
*
|
|
41538
|
-
* @param argument - The value to convert
|
|
41539
|
-
*
|
|
41540
|
-
* @returns The parsed date in the local time zone
|
|
41541
|
-
*
|
|
41542
|
-
* @example
|
|
41543
|
-
* // Clone the date:
|
|
41544
|
-
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
41545
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
41546
|
-
*
|
|
41547
|
-
* @example
|
|
41548
|
-
* // Convert the timestamp to date:
|
|
41549
|
-
* const result = toDate(1392098430000)
|
|
41550
|
-
* //=> Tue Feb 11 2014 11:30:30
|
|
41551
|
-
*/
|
|
41552
|
-
function toDate(argument, context) {
|
|
41553
|
-
// [TODO] Get rid of `toDate` or `constructFrom`?
|
|
41554
|
-
return (0, _index.constructFrom)(context || argument, argument);
|
|
41555
|
-
}
|
|
41556
|
-
|
|
41557
|
-
|
|
41558
37999
|
/***/ }
|
|
41559
38000
|
|
|
41560
38001
|
/******/ });
|