# Dayhaven 1.0.0

A free original fullscreen jQuery date field for constrained form entry. Choose an available day, review it, then confirm a YYYY-MM-DD value into your own named input. Escape/Cancel leaves that field unchanged. No account, booking backend, API or telemetry.

## Start in a minute

Extract the ZIP without changing its structure. Open app/index.html in a modern browser, or serve the extracted folder locally:

```sh
python3 -m http.server 8809 --bind 127.0.0.1 --directory /path/to/dayhaven
```

Visit http://127.0.0.1:8809/app/index.html. No npm install/build is needed to use the delivered component. The supported real QA route is declared in evidence; file-origin use is technically self-contained but not independently certified by that route. jQuery 4.0.0 is bundled locally; no CDN calls.

1. In the fictional Alder Workshop form, click Choose date. The full-screen dialog opens with the existing date as a draft. Sundays and explicit studio closures are unavailable.
2. Choose a valid day, review the summary and click Use date. The host field changes only now; Preview form result reads native FormData locally. No request is sent and no booking is made. The inspection field is a separate instance with different rules.
3. Type an ISO date directly if desired. Invalid, closed, out-of-window or impossible dates show a message and native form validation prevents submission. Host servers must still revalidate untrusted client data independently. Calling native form.submit() bypasses client validation, as on ordinary HTML forms; use requestSubmit() for that behavior.
4. Change display language/min/max and Apply field rules. The current field values remain, and rules that would invalidate them are rejected. JSON presets expose full options. Display labels are localized EN/TR/DE; workbench help and validation messages are English.
5. Save preset JSON downloads both complete field configurations, without current field values or submitted results. Open preset uses a file chooser and validates both before either changes. Files up to100KB. Invalid imports preserve all existing rules and values. There is no localStorage draft; download before closing the tab.
6. Export working form HTML downloads a complete functioning two-field form with jQuery, component, styles and preset embedded. Open that actual file, choose a date and preview FormData. It has no external runtime dependencies or analytics. Share/embed outputs under LICENSE.txt; keep bundled MIT notice.

## Integrate the actual component

Use your existing jQuery instance, core, plugin and CSS. Avoid loading another copy of jQuery. The example bundles4.0.0; other jQuery versions are not certified by this release.

```html
<link rel="stylesheet" href="styles/dayhaven.css">
<label for="day">Pickup date</label>
<input id="day" name="pickup_date" required placeholder="YYYY-MM-DD">
<script src="vendor/jquery-4.0.0.min.js"></script>
<script src="lib/core.js"></script>
<script src="lib/dayhaven.js"></script>
<script>
jQuery('#day').dayhaven({
  label: 'Pickup day', min: '2026-11-01', max: '2027-03-31',
  disabledWeekdays: [0], disabledDates: ['2026-11-26'],
  locale: 'en-US', weekStart: 1, required: true
});
</script>
```

The plugin enhances text/date inputs, keeps a visible trigger and text input, and does not take over form submission. For initially disabled inputs it stays disabled. Required in HTML stays required even if options omit it. Closed weekdays use0Sunday–6Saturday. `disabledDates` is up to512 strict ISO strings. Min/max default1900-01-01/2100-12-31. At least one permitted day must remain. Unknown options are rejected. Use fixed actual date windows for your business; this example's dated window is deliberate and does not promise future live availability.

| API | Result |
|---|---|
| .dayhaven(options) | Initialize once, chainable; repeat does not duplicate |
| .dayhaven('open') | Open the field's modal; another open Dayhaven instance cancels |
| .dayhaven('close') | Cancel draft, preserve field |
| .dayhaven('getDate') | Current first field string, may be invalid if user typed it |
| .dayhaven('setDate', '2026-11-12') | Validate and assign ISO, emit native change; throws atomically on invalid |
| .dayhaven('getConfig') | Defensive config copy |
| .dayhaven('update', options) | Complete replacement config, validated before mutation; preserves valid field |
| .dayhaven('destroy') | Close, remove own listeners/trigger/error, restore original input attributes; keep value |

`change` fires on confirmation or valid setDate. `dayhaven:confirm` supplies the confirmed ISO as the second jQuery handler argument, even if the same date was confirmed. `dayhaven:open` and `dayhaven:close` are separate lifecycle events; close supplies `{committed: boolean}`. Editing the field directly uses ordinary native input/change. Do not treat open/navigation as a confirmed choice. Programmatic `.val()` does not trigger input validation until change/input, open/confirm or form submit, so use setDate or dispatch change.

## Keyboard and constraints

Native `<dialog>.showModal()` provides modal background isolation. Escape or Cancel restores the opener; Tab/Shift+Tab stays inside. Arrows move day/week focus and skip unavailable dates. Home/End aim at week edges; PageUp/Down moves month with day clamping, Shift+PageUp/Down year. Enter/Space chooses the focused day, then Use date confirms. Month/year dropdowns support distant dates. Required fields cannot clear; optional Clear selection is only committed with Use date. Today may be unavailable and then shows an explicit message.

ISO Gregorian dates1900–2100, no ranges/time/timezone conversion. UTC day arithmetic avoids DST gaps; Today uses the user's local calendar date. EN-US/TR-TR/DE-DE Intl display; ISO submission unchanged. Native dialog/Intl/Blob modern browser required; old Internet Explorer unsupported. Physical touch, mobile screen readers and other browser engines need integration-specific checks. A narrow desktop viewport is not physical device certification. Host-specific CSS must be reviewed alongside the scoped component CSS.

## Edit and reproduce

Editable source: lib/core.js, lib/dayhaven.js, styles/dayhaven.css; workbench app/studio.js and app/studio.css. `python3 scripts/build.py` rebuilds the exact ordered app/runtime.js and export helper from supplied local sources, with jQuery's full MIT notice embedded. The script tag is after the DOM. The shipping runtime and generated examples need no build service.

The separate producer source workspace has Node/jsdom tests and package-lock; these internal test dependencies and QA files are intentionally excluded from the customer ZIP. Tests verify date rules, transactions, lifecycle, independent forms, exact entry initialization, output safety and hosted privacy. Actual CUA receipts verify rendered UI and genuine download/chooser roundtrip separately. No CLI test is claimed as a real user interaction.

## Terms and privacy

LICENSE.txt is the approved Nishvault Free Product Use Terms v1, byte-exact. Personal/commercial project use and output sharing/embedding/sale are permitted. Redistribution/resale of the product package or rebranded competing copy is not authorized. No paid checkout, guaranteed support, SLA or update schedule. Optional integration needs a separate agreed scope. jQuery MIT rights remain separate; see THIRD_PARTY.md and vendor/jquery-LICENSE.txt.

Offline source/runtime/output uses no fetch, storage, analytics, external fonts or remote services. Hosted diagnostic adapter is a separate publisher-only asset excluded from this ZIP. It counts confirmed date actions with fixed product/action/internal fields, observes DNT/GPC, and sends no date, field label, configuration, identity or FormData. Preparation does not prove live persistence. Sharing output/presets intentionally shares embedded labels and rules: avoid sensitive content.
