{"_id":"@almaiura/legal-deadline-calculator","name":"@almaiura/legal-deadline-calculator","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@almaiura/legal-deadline-calculator","version":"0.1.0","description":"Italian legal deadline calculator with civil procedural rules, holidays and ferial/covid suspensions.","type":"module","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","test":"npm run build && node --test test/*.test.mjs"},"keywords":["termini-processuali","scadenze","sospensione-feriale","italia","legaltech"],"license":"MIT","devDependencies":{"typescript":"^5.8.3"},"engines":{"node":">=20"},"gitHead":"c132df82e3bb2d030c147a4a968e0788075e4914","_id":"@almaiura/legal-deadline-calculator@0.1.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-ohBj2SMyzcqRORXt6wDOqyUty1+SV/ly3SEwwXK/XTpQL/wCMAv8ENSQJk6cfdq1xgasVMq5w2Bvi/h+m9UkMw==","shasum":"f900db9fa93026880c6a3821b0074da77ba49a53","tarball":"https://registry.npmjs.org/@almaiura/legal-deadline-calculator/-/legal-deadline-calculator-0.1.0.tgz","fileCount":6,"unpackedSize":52914,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFmq641/GOO7e0j9dXsRjBOp5g/mPOLXPSn+RXI4FNJmAiAtjZytxda3QdMeDV2d8/UUh37Cv+MGsPgNBFUhvh8XJg=="}]},"_npmUser":{"name":"versusf","email":"controfilippo8@gmail.com"},"directories":{},"maintainers":[{"name":"versusf","email":"controfilippo8@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/legal-deadline-calculator_0.1.0_1780069121163_0.9507102702328105"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-29T15:38:41.070Z","0.1.0":"2026-05-29T15:38:41.359Z","modified":"2026-05-29T15:38:41.544Z"},"maintainers":[{"name":"versusf","email":"controfilippo8@gmail.com"}],"description":"Italian legal deadline calculator with civil procedural rules, holidays and ferial/covid suspensions.","keywords":["termini-processuali","scadenze","sospensione-feriale","italia","legaltech"],"license":"MIT","readme":"# @almaiura/legal-deadline-calculator\n\nTypeScript calculator for Italian civil procedural deadlines.\n\nHandles:\n\n- day and week terms, with the *dies a quo* excluded;\n- free day terms, with both the *dies a quo* and the *dies ad quem* excluded;\n- month and year terms *ex nominatione dierum*;\n- historical summer judicial suspension: until 2014 `01/08–15/09`, from 2015 `01/08–31/08`;\n- extraordinary Covid-19 civil suspension `09/03/2020–11/05/2020`;\n- Italian national holidays and Easter Monday;\n- optional local holidays;\n- forward roll pursuant to art. 155 Italian Code of Civil Procedure;\n- prudential backward calculation, moving back to the previous business day when the date falls on a Saturday, Sunday, or holiday.\n\n> Note: this package implements general rules and must be validated against the specific use case. The summer suspension does not apply to all proceedings.\n\n## Installation\n\n```bash\nnpm install @almaiura/legal-deadline-calculator\n```\n\n## Basic usage\n\n```ts\nimport { calculateDeadline } from \"@almaiura/legal-deadline-calculator\";\n\nconst result = calculateDeadline({\n    startDate: \"2026-07-20\",\n    amount: 30,\n    unit: \"days\",\n    direction: \"forward\",\n    suspensions: true,\n    roll: \"procedural\",\n});\n\nconsole.log(result.dueDate);\nconsole.log(result.adjustments);\n```\n\n## Examples\n\n### Saturday roll under art. 155 c.p.c.\n\n```ts\ncalculateDeadline({\n    startDate: \"2016-12-04\",\n    amount: 20,\n    unit: \"days\",\n    direction: \"forward\",\n}).dueDate;\n// => \"2016-12-27\"\n```\n\n### Holiday Friday: Saturday allowed if not itself a holiday\n\n```ts\ncalculateDeadline({\n    startDate: \"2013-10-02\",\n    amount: 30,\n    unit: \"days\",\n    direction: \"forward\",\n}).dueDate;\n// => \"2013-11-02\"\n```\n\n### Prudential backward deadline\n\n```ts\ncalculateDeadline({\n    startDate: \"2013-11-13\",\n    amount: 10,\n    unit: \"days\",\n    direction: \"backward\",\n}).dueDate;\n// => \"2013-10-31\"\n```\n\n### Summer suspension before 2015\n\n```ts\ncalculateDeadline({\n    startDate: \"2013-07-12\",\n    amount: 20,\n    unit: \"days\",\n    suspensions: true,\n    includeCovid2020: false,\n}).dueDate;\n// => \"2013-09-16\"\n```\n\n### Local holiday\n\n```ts\ncalculateDeadline({\n    startDate: \"2026-06-28\",\n    amount: 1,\n    unit: \"days\",\n    extraHolidays: [{ date: \"2026-06-29\", name: \"Saints Peter and Paul - Rome\" }],\n}).dueDate;\n```\n\n## API\n\n```ts\ntype DeadlineUnit = \"days\" | \"weeks\" | \"months\" | \"years\";\ntype DeadlineDirection = \"forward\" | \"backward\";\ntype DeadlineRoll = \"procedural\" | \"generic\" | \"none\";\n\ninterface CalculateDeadlineInput {\n    startDate: string; // YYYY-MM-DD\n    amount: number;\n    unit?: DeadlineUnit;\n    direction?: DeadlineDirection;\n    freeTerm?: boolean;\n    suspensions?: boolean;\n    includeCovid2020?: boolean;\n    extraSuspensionIntervals?: { start: string; end: string; reason?: string }[];\n    extraHolidays?: { date: string; name: string }[];\n    roll?: DeadlineRoll;\n}\n```\n\n`roll: \"procedural\"` replicates the prudential behaviour best suited for civil procedural deadlines:\n\n- forward: Sundays and national/local holidays roll to the next non-holiday day;\n- forward: if the calculated date falls exactly on a Saturday, it rolls to the next non-holiday day;\n- forward: if the calculated date falls on a holiday Friday, the following Saturday may be valid if it is not itself a holiday;\n- backward: Saturdays, Sundays, and holidays move back to the previous business day.\n\n## Build and test\n\n```bash\nnpm install\nnpm test\n```\n\n## npm publishing\n\n```bash\nnpm version patch\nnpm publish --access public\n```\n\nFor a private scoped package, use your organisation's npm configuration.\n","readmeFilename":"README.md","_rev":"1-1497d9fab3916ba1debe81d2f2ff94ad"}