🟨
JavaScript ES module classes exported under a single Timely namespace.
## 📦 Namespace (`src/timely/index.js`)
All classes are re-exported from [`index.js`](../src/timely/index.js), so they can be imported as one namespace object:
```js
import * as Timely from "./src/timely/index.js";
Timely.Helper.isLeap(2000); // true
Timely.Calculator.sundayOudin(2014); // Date of Easter Sunday
```
Named imports work as well:
```js
import {Helper, Calculator} from "./src/timely/index.js";
```
When the package is installed from npm, the entry point is defined by `exports` in `package.json`:
```js
import * as Timely from "@hermajan/timely";
```
## 🧩 Classes
| Class | File | Static methods |
|---------------|---------------------------|-------------------------------------------------------|
| `YearHelper` | `years/Helper.js` | `isLeap(year)`, `isLeap2(year)` |
| `DateFormatter` | `dates/DateUtil.js` | `dayOfWeek(lang, date)`, `formatDate(date)` |
| `Week` | `dates/Week.js` | `cs`, `en` (names of the days of the week) |
| `EasterCalculator` | `easter/Calculator.js` | `sundayOudin(year)`, `friday(year)`, `monday(year)` |
| `CzechNameDayFinder` | `namedays/czech/CzechFinder.js` | `nameDay(day, month)`, `todayName()`, `getName(date)` |
| `SlovakNameDayFinder` | `namedays/slovak/SlovakFinder.js` | the same as `CzechNameDayFinder` |
The clocks in `clocks/` are still plain scripts and are not part of the namespace.
## 🌐 Usage in a browser
Use a module script. Module scripts are deferred, so do not use `document.write()`; fill elements instead:
```html
```
Working demos are in the [Examples](Examples.md).
Browsers do not load modules from `file://`, so serve the project through a local web server (e.g. `npx serve` or `python -m http.server`).