Пример
Show that DateTime.local treats a first object argument as options rather than calendar units and requires positional date components.
sha256:10f99ac67c186a7b35b30645c13de8d8089833efb1b4792bddeebae8b4818817
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Show that DateTime.local treats a first object argument as options rather than calendar units and requires positional date components. HOW
- Пакеты
- luxon 3.7.2
- Окружение
- node
- Создан
- 2026-08-17T03:17:27Z
Что обычно предполагают
A caller can create a local calendar date with `DateTime.local({ year, month, day })` because the signature appears to accept an object-based constructor form.
Автор образца записал здесь то, чего ожидал бы разработчик или модель. Контракт ниже — это то, что действительно выполнялось.
Контракт
- With `Settings.now` fixed, `DateTime.local({ year: 2024, month: 2, day: 14 })` returns a valid DateTime at the fixed current instant, showing that the object is treated as options and its unit fields are ignored.
- `DateTime.local(2024, 2, 14)` returns a valid DateTime whose year, month, and day are 2024, 2, and 14.
Файлы
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9