Notice Period Check

Works out the real last working day from a resignation and the notice policy, so nobody resigns towards the wrong date.

StopsWrong last working day after resigning

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/notice-period-check.json

The files land in your project. They're yours to edit.

Usage

notice-period-check-usage.tsx
import { NoticePeriodCheck, type NoticeInput, type NoticePolicy } from "@/components/ui/notice-period-check"

<NoticePeriodCheck policy={POLICY} timeZone="Asia/Kolkata" holidays={HOLIDAYS} leaveBalance={6} value={value} onValueChange={setValue} />

What it catches

  • Month-end arithmetic such as 31 Jan + 1 month
  • Last day on a weekend or holiday
  • Resignation email dated differently in HR's time zone
  • Unpaid leave pushing the date out, and leave set-off
  • Buyout cost of leaving early, plus a line to copy to HR

Props

NoticePeriodCheck props
PropTypeDefault
policy* (required)

Notice length and the rules that move it.

NoticePolicy—
value

Controlled input.

NoticeInput—
defaultValue

Initial input when uncontrolled.

Partial<NoticeInput>—
onValueChange

Called on every edit or fix.

(value: NoticeInput) => void—
onResultChange

Called whenever the result changes, for saving or showing elsewhere.

(result: NoticeResult | null) => void—
timeZone

The employee's IANA time zone, where "Resignation sent" is read.

string"Asia/Kolkata"
holidays

Public and company holidays.

Holiday[][]
leaveBalance

Leave days available to set off against notice.

number—
locale

Locale for dates and money.

string"en-IN"
currency

ISO 4217 currency for the buyout.

string"INR"
messages

Any visible string.

Partial<NoticePeriodMessages>—

* required. Also accepts the native props of <section> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Section labelled by its heading; every input has a visible label
  • The sent-at field's label names the time zone
  • Focus moves to the first fix after a change

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

  • Your contract and policy decide; defaults (notice from the next day) are the common reading, not a rule
  • Holidays and leave balance come from your props
  • Not legal advice

Rules

Rules last verified:

Informational, not legal advice. Confirmed the UK reading that notice usually runs from the day after it is handed in. Indian contract practices mentioned in the code were not verified. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What it stops

Wrong last working day after resigning

Also known as

notice period · resignation · last working day · lwd · hr portal · exit · notice buyout · relieving

Dependencies

Pairs well with