Rust WebAssembly Jalali/Shamsi date controls and calendar views for Leantime. Development source and tests.
  • JavaScript 65.9%
  • Rust 17.4%
  • HTML 8.5%
  • CSS 6.3%
  • PHP 1.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-05 17:55:27 +03:30
LICENSES Checkpoint tested Jalali forms and calendar integration 2026-11-05 12:09:29 +03:30
plugin/TafaJalali Checkpoint tested Jalali forms and calendar integration 2026-11-05 12:09:29 +03:30
src Checkpoint tested Jalali forms and calendar integration 2026-11-05 12:09:29 +03:30
tests Verify adapter lifecycle and improve light and dark theme contrast 2026-11-05 17:43:51 +03:30
tools Verify adapter lifecycle and improve light and dark theme contrast 2026-11-05 17:43:51 +03:30
web Verify adapter lifecycle and improve light and dark theme contrast 2026-11-05 17:43:51 +03:30
.gitattributes Checkpoint tested Jalali forms and calendar integration 2026-11-05 12:09:29 +03:30
.gitignore Checkpoint tested Jalali forms and calendar integration 2026-11-05 12:09:29 +03:30
Cargo.lock Develop Rust WASM Jalali core and Leantime integration adapter 2026-11-05 11:10:29 +03:30
Cargo.toml Develop Rust WASM Jalali core and Leantime integration adapter 2026-11-05 11:10:29 +03:30
CHECKPOINT.md Record verified live Jalali deployment and backup inclusion 2026-11-05 17:55:27 +03:30
LICENSE Develop Rust WASM Jalali core and Leantime integration adapter 2026-11-05 11:10:29 +03:30
README.md Verify adapter lifecycle and improve light and dark theme contrast 2026-11-05 17:43:51 +03:30

Tafa Jalali for Leantime

A Leantime plugin with a Rust calendar core compiled to WebAssembly. A PHP registration layer and JavaScript adapter connect it to Leantime's existing interface. No Rust service, PHP FFI, database migration, or external runtime is required.

Public development repository: taha/leantime-jalali-rust.

Version 0.1.0 targets Leantime 3.13.2. Browser/database acceptance uses a separate installation with synthetic data. See CHECKPOINT.md for verified behavior and deployment status.

Design

  • Jalali/Shamsi input and Saturday-first date pickers, accepting Persian, Arabic-Indic and Latin digits.
  • Original Leantime fields retain Gregorian dates in the user's existing format. Forms and existing async handlers receive those original values. APIs, reminders and exports retain their existing behavior.
  • Calendar month navigation and date ranges follow Jalali months; day/week headers show Jalali dates. Calendar event sources, drag/drop, resize and time zones remain owned by FullCalendar and Leantime.
  • Gregorian mode remains available through a browser-local toggle.
  • Invalid dates (including Esfand 30 in a common year) do not reach the original field or save handlers.
  • Opaque, theme-aware controls with visible focus, selected/today indicators and contrasting calendar event text. Stock light/dark themes are checked at desktop and 390px mobile widths.
  • The supported conversion range is Jalali years 1200–1499 inclusive. New Jalali values outside it are rejected; existing unsupported Gregorian values retain their stock control and are preserved. This is an arithmetic civil-calendar implementation, not an astronomical prediction service.

The Rust core ports the Borkowski algorithm used by jalaali-js 1.2.8, with its license preserved in LICENSES/. The core uses no dependencies, network calls, filesystem access, or imported WASM functions.

Build and tests

Requirements: stable Rust with wasm32-unknown-unknown, and Node.js 22 or newer.

rustup target add wasm32-unknown-unknown
cargo test
node tools/build.mjs
node tests/wasm.mjs

plugin/TafaJalali/ is the installable plugin folder after the build. Generated JavaScript embeds the compiled WASM bytes, so loading the calendar does not require extra network requests or a separate WASM MIME configuration. Assets are content-hashed and registered with Leantime's manifest-backed asset API.

Compatibility and installation

The adapter is developed against Leantime 3.13.2, and the plugin compatibility constraint intentionally pins that release. Test a newer Leantime release before widening the constraint.

  1. Back up the application database, uploads, configuration and plugins.
  2. Build the plugin and copy the TafaJalali folder into app/Plugins/.
  3. In Leantime, discover/install the plugin and enable it under Installed Plugins.
  4. Allow 'wasm-unsafe-eval' in every enforced Content-Security-Policy script-src policy. The plugin adds this narrow permission to Leantime's own CSP; reverse-proxy policies must be adjusted separately. JavaScript eval is not required or enabled.
  5. Verify date entry, deadlines, month navigation, drag/drop and exports with representative project data.

Disabling the plugin or selecting Gregorian mode restores the original controls. No date data is converted in storage, and removal has no schema rollback.

Coverage and limits

The adapter targets the stock date inputs, task due/planned dates, project/milestone/sprint dates, calendar event forms, and FullCalendar day/week/month/year views in 3.13.2. The year view uses a continuous Jalali-year day grid. Third-party plugins with custom date widgets, Gantt axis labels, server-generated emails, printed reports and exports are not reformatted. Exported and API dates remain standard Gregorian values.

Verification status

  • Native Rust tests include Nowruz and leap-year anchors, invalid/boundary dates and exhaustive round trips for every supported Jalali date.
  • WASM tests compare every Gregorian day from 1821 through 2121 with an independent ICU/Intl Persian-calendar implementation, including rejection outside the supported Jalali boundaries.
  • Isolated browser/database integration passed for calendar event input across Nowruz, leap-day validation, task due/planned dates, typed and selected inline deadlines, date clearing, month/week/year views, native event drag/drop, Gregorian iCalendar export, and preservation of existing out-of-range dates.
  • Keyboard navigation, min/max constraints, disabled/read-only propagation, five repeated HTMX swaps, Gregorian-mode fallback, dashboard/day labels, view transitions, full-form date clearing and native event resizing passed isolated acceptance.
  • Stock light/dark themes passed visual checks at 1280 × 900 and 390 × 844; measured normal/secondary/selected text contrast exceeds 4.5:1 and control boundaries exceed 3:1. See tests/README.md.

License

MIT. Third-party calendar algorithm attribution is in LICENSES/jalaali-js-MIT.txt.