Download the PHP package hussainweb/taarikh-picker without Composer

On this page you can find all versions of the php package hussainweb/taarikh-picker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package taarikh-picker

@taarikh/picker

A lightweight, accessible Hijri calendar date picker with zero third-party dependencies, built with vanilla TypeScript and modern web standards.

CI npm version


Features


Installation

Via npm (Date Picker UI)

Import JavaScript and CSS into your project:

Headless Usage via @taarikh/core

For server-side Node.js, CLI applications, or custom UI components needing only calendar arithmetic without DOM or CSS dependencies:

Via Composer (Drupal Library / Packagist)

For Drupal sites using Composer with composer/installers, install directly into libraries/taarikh-picker:

Via IIFE (Direct Script Tag)

Compiled standalone assets are provided in dist/:


Quick Start

Given an HTML <input> element:

Initialize the picker:

With the IIFE global:


API Reference

createPicker(input, options?)

Factory function that creates and returns a TaarikhPicker instance.

TaarikhPickerOptions

Option Type Default Description
engine CalendarEngine fatimidAstronomicalCalendar Pluggable calendar engine implementing Julian Day conversion.
dir "ltr" \| "rtl" \| "auto" "auto" Text direction. "auto" detects from input.closest('[dir]'), computed style, or document.dir.
locale string undefined (browser default) BCP 47 locale tag (e.g. 'ar', 'ar-EG', 'fa', 'ur', 'en') used for weekday resolution and numeral formatting.
firstDayOfWeek number (0–6) Derived from Intl.Locale First day of week, where 0 = Sunday, 1 = Monday, ..., 6 = Saturday.
initialDate PlainDate undefined (today) Date to focus and display on first open when the input is empty.
selectedDate PlainDate Parsed from input value Initially selected date.
minDate PlainDate undefined Earliest selectable date. Earlier dates and previous months/years are disabled.
maxDate PlainDate undefined Latest selectable date. Later dates and next months/years are disabled.
valueFormat / valuePattern string "YYYY-MM-DD" Formatting pattern for submitted input value.
labels PickerLabels DEFAULT_LABELS Custom string overrides for buttons, dialog, months, weekdays, and announcements.
idPrefix string "tp" Prefix used for generated dialog element IDs.
onSelect (date: PlainDate) => void undefined Callback fired when a date is selected.
onOpen () => void undefined Callback fired when the dialog opens.
onClose () => void undefined Callback fired when the dialog closes.
onMonthChange (date: PlainDate) => void undefined Callback fired when visible month/year changes.
onToday (todayDate: PlainDate) => void undefined Callback fired when the Today button is clicked.
onClear () => void undefined Callback fired when the Clear button is clicked.

PlainDate

PickerLabels

All strings are optional and fall back to localized English/Fatimid defaults:

Instance Methods

A TaarikhPicker instance returned by createPicker() exposes:

Explicit Resource Management (using)

In TypeScript / JavaScript environments supporting Symbol.dispose:

Events

Selecting a date, clicking Today, or clicking Clear dispatches:

  1. Standard native input event (bubbles).
  2. Standard native change event (bubbles).
  3. Custom taarikh:change event (bubbles):

Styling & Design Tokens

The stylesheet is designed so that generic host theme rules (such as table, th, td, .form-item button, or .form-item select in CMS themes like Drupal Claro/Gin) cannot accidentally break the picker's layout, while intentional customization remains straightforward:

  1. CSS Custom Properties ((0, 0, 0) specificity): Declared on :where(:root, :host), so setting --tp-* tokens on :root, a form wrapper, or .tp-dialog always takes precedence regardless of stylesheet load order.
  2. Flat Component Selectors ((0, 2, 0) specificity): Internal elements use uniform .tp-dialog .tp-<element> selectors (and .tp-btn-trigger.tp-btn-trigger for the trigger button). To override a rule directly, target .tp-dialog .tp-<element> in a stylesheet loaded after @taarikh/picker/style.css, or scope with a wrapper class (e.g., .my-form .tp-dialog .tp-day-btn).
  3. Optional Cascade Layering: If your application manages styles via CSS Cascade Layers, import the stylesheet into your desired layer:

CSS Custom Properties (--tp-*)

Override any of the design tokens on :root, a form container, or .tp-dialog:

Dark Mode & High Contrast


Accessibility & Keyboard Navigation

The picker adheres strictly to the WAI-ARIA APG Date Picker Dialog specification:

Keyboard Shortcuts

Key Action
ArrowRight Move focus to the next day in LTR (previous day in RTL).
ArrowLeft Move focus to the previous day in LTR (next day in RTL).
ArrowDown Move focus to the same weekday in the next week (+7 days).
ArrowUp Move focus to the same weekday in the previous week (-7 days).
Home Move focus to the first day of the current week.
End Move focus to the last day of the current week.
PageDown Navigate to the same day in the next month.
PageUp Navigate to the same day in the previous month.
Shift + PageDown Navigate to the same day in the next year.
Shift + PageUp Navigate to the same day in the previous year.
Enter / Space Select the focused day, write to input, and close dialog.
Escape Dismiss dialog without changing date; return focus to trigger button.
Tab Cycle forward through interactive controls within dialog (Prev, Month, Year, Next, Grid, Today, Clear).
Shift + Tab Cycle backward through interactive controls within dialog.

Migration from kbwood/jquery.calendars

If you are migrating from Keith Wood's jquery.calendars.picker (commonly used in legacy Drupal modules):

kbwood/jquery.calendars @taarikh/picker Notes
$(input).calendarsPicker({ calendar: $.calendars.instance('islamic') }) createPicker(input) Zero jQuery required; defaults to Fatimid astronomical engine.
dateFormat: 'yyyy-mm-dd' valueFormat: 'YYYY-MM-DD' Defaults to ISO YYYY-MM-DD with zero-padded ASCII numerals.
minDate: ... / maxDate: ... minDate: PlainDate / maxDate: PlainDate Typed { year, month, day } object instead of CDate or string.
defaultDate: ... initialDate: PlainDate PlainDate object representing the opening month/day.
firstDay: 6 firstDayOfWeek: 6 0 = Sunday, 6 = Saturday; defaults automatically from locale.
isRTL: true dir: "rtl" or dir: "auto" Automatically detects RTL from ancestor attributes and styles.
onSelect: function(dates) onSelect: (date) => void or taarikh:change event Emits typed { detail: { date, value } } event.
showTrigger: '<button>...' Built-in accessible trigger Created automatically as sibling <button type="button" class="tp-btn-trigger">.
showOnFocus: false Default behavior Never opens on input focus; requires deliberate trigger click or keyboard entry.
commands: { today: ..., clear: ... } labels: { today: '...', clear: '...' } Configured directly in the labels dictionary.
$(input).calendarsPicker('destroy') picker.destroy() Idempotent cleanup removing listeners and dialog DOM nodes.
$(input).calendarsPicker('setDate', date) picker.setDate(date) Programmatic date setter.
$(input).calendarsPicker('getDate') picker.getDate() Returns PlainDate \| null.

Browser Support


License

MIT © Hussain Abbas


All versions of taarikh-picker with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hussainweb/taarikh-picker contains the following files

Loading the files please wait ...