mirror of
https://github.com/acamarata/date-fns-hijri.git
synced 2026-06-30 18:54:25 +00:00
Behavior changes (lock-step with hijri-core fix/utc-day-boundary): - toHijriDate and all field/format/comparison/arithmetic functions now lift input Dates through localDayToUtcSlot() before calling coreToHijri(), reading the caller's LOCAL calendar day (date-fns convention). Previously passed the raw Date which caused off-by-one results in timezones west of UTC against the new UTC-day core contract. - fromHijriDate now returns local-midnight Dates (new Date(y, m, d)) instead of UTC midnight. Local field accessors and date-fns format() render the intended calendar day on every host timezone. toISOString() is no longer the right API for this value. - addHijriMonths, addHijriYears, startOfHijriMonth, endOfHijriMonth call fromHijriDate directly; the utcMidnightToLocalNoon shim is removed. - Round-trip toHijriDate(fromHijriDate(y, m, d)) is now exact on every timezone. Verified: 58/58 ESM tests, 10/10 CJS tests, 16/16 vitest assertions across TZ=UTC, TZ=America/New_York, and TZ=Pacific/Auckland.
95 lines
2.6 KiB
JSON
95 lines
2.6 KiB
JSON
{
|
|
"name": "date-fns-hijri",
|
|
"version": "1.0.2",
|
|
"description": "date-fns-style utility functions for Hijri calendar operations. Wraps hijri-core with a functional API for converting, formatting, and validating Hijri dates.",
|
|
"author": "Aric Camarata",
|
|
"license": "MIT",
|
|
"main": "./dist/index.cjs",
|
|
"module": "./dist/index.mjs",
|
|
"types": "./dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"import": "./dist/index.mjs",
|
|
"require": "./dist/index.cjs"
|
|
},
|
|
"./package.json": "./package.json"
|
|
},
|
|
"sideEffects": false,
|
|
"files": [
|
|
"dist/index.cjs",
|
|
"dist/index.mjs",
|
|
"dist/index.d.ts",
|
|
"dist/index.d.mts",
|
|
"README.md",
|
|
"CHANGELOG.md",
|
|
"LICENSE"
|
|
],
|
|
"engines": {
|
|
"node": ">=20"
|
|
},
|
|
"packageManager": "pnpm@10.30.1",
|
|
"scripts": {
|
|
"build": "tsup",
|
|
"typecheck": "tsc --noEmit",
|
|
"pretest": "tsup",
|
|
"test": "node --test test.mjs && node --test test-cjs.cjs",
|
|
"lint": "eslint src/",
|
|
"format": "prettier --write src/",
|
|
"format:check": "prettier --check src/",
|
|
"prepublishOnly": "pnpm run build",
|
|
"coverage": "c8 --reporter=lcov --reporter=text node test.mjs",
|
|
"docs": "typedoc --out .github/wiki/api src/index.ts",
|
|
"postbuild": "cp dist/index.d.ts dist/index.d.mts",
|
|
"test:vitest": "vitest run"
|
|
},
|
|
"keywords": [
|
|
"date-fns",
|
|
"hijri",
|
|
"islamic",
|
|
"calendar",
|
|
"umm-al-qura",
|
|
"fcna",
|
|
"gregorian",
|
|
"converter",
|
|
"typescript",
|
|
"functional"
|
|
],
|
|
"peerDependencies": {
|
|
"hijri-core": "^1.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@acamarata/eslint-config": "^0.1.0",
|
|
"@acamarata/prettier-config": "^0.1.0",
|
|
"@acamarata/tsconfig": "^0.1.0",
|
|
"@eslint/js": "^10.0.1",
|
|
"@types/node": "^25.3.5",
|
|
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
"@typescript-eslint/parser": "^8.56.1",
|
|
"c8": "^10.1.3",
|
|
"eslint": "^10.0.3",
|
|
"eslint-config-prettier": "^10.1.8",
|
|
"hijri-core": "^1.0.0",
|
|
"prettier": "^3.8.1",
|
|
"tsup": "^8.0.0",
|
|
"typedoc": "^0.28.19",
|
|
"typedoc-plugin-markdown": "^4.11.0",
|
|
"typescript": "^5.5.0",
|
|
"typescript-eslint": "^8.56.1",
|
|
"vitest": "^2.1.9"
|
|
},
|
|
"publishConfig": {
|
|
"access": "public",
|
|
"registry": "https://registry.npmjs.org/"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/acamarata/date-fns-hijri.git"
|
|
},
|
|
"homepage": "https://github.com/acamarata/date-fns-hijri#readme",
|
|
"bugs": {
|
|
"url": "https://github.com/acamarata/date-fns-hijri/issues"
|
|
},
|
|
"type": "module",
|
|
"prettier": "@acamarata/prettier-config"
|
|
}
|