ChronosChronos

Palindrome Plugin

Palindrome Plugin — Chronos Plugin Documentation.

About Palindrome Plugin

Palindrome plugin is a plugin that adds palindrome date related functionalities to Chronos.

Import & Usage

Import

To use the Palindrome Plugin, import it first:

import { Chronos, chronos } from "chronos-date";
import { palindromePlugin } from 'chronos-date/plugins/palindromePlugin';

Register

Now you can use the plugin's methods:

// Register the plugin globally
Chronos.use(palindromePlugin);
// or
chronos.use(palindromePlugin);
// or
Chronos.register(palindromePlugin);
// or
chronos.register(palindromePlugin);

Usage

Example usage of the palindromePlugin:

const c = new Chronos();

const isPalindrome = c.isPalindromeDate();

console.log(isPalindrome);

Example Usage

playground.ts

Overview

The palindromePlugin adds comprehensive palindrome date functionalities to Chronos, enabling:

  • Determining whether a given date is a palindrome date
  • Determining whether a given date is a palindrome date with short year

Methods Added by the Plugin

Note

All these methods are provided by palindromePlugin. You must register it using Chronos.use(palindromePlugin) before calling them. Once registered, all Chronos instances will have access to these methods.

MethodDescriptionReturns
isPalindromeDateDetermines whether a given date is a palindrome date or notboolean

API Reference

isPalindromeDate()

Signature

isPalindromeDate(shortYear?: boolean): boolean

Parameters

  • shortYear: Use 2-digit year (default: false)

Return Type

boolean - Whether palindrome date

Example

import { palindromePlugin } from 'chronos-date/plugins/palindromePlugin';

Chronos.use(palindromePlugin);

new Chronos('2020-02-02').isPalindromeDate(); // true

Last updated: Wed, Jun 24, 2026 09:04:13AM (UTC)

On this page