1.0.0 • Published 6 months ago

tictic v1.0.0

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
6 months ago

tictic

A versatile and efficient JavaScript library for formatting date and time.

Table of Contents

  1. Features
  2. Installation
  3. Usage
  4. API Reference
  5. License

Features

  • Date Formatting: Customize the output format for dates.
  • Name of Months: Input custom names for months.
  • Day Increment/Decrement: Modify the date by incrementing or decrementing days.
  • Weekday Formatting: Control how weekdays are displayed with localization and other options.
  • Time Formatting: Format time with support for 12-hour or 24-hour formats.
  • Valid Time Formats: Use predefined valid time formats for ease of use.

Installation

Install tictic via npm:

npm install tictic --save

Docs 1.0.0

Usage

Date Formatting

Here's how you can use tictic to format dates:

import { getFormattedDate } from 'tictic'

const formattedDate = getFormattedDate({
  date: new Date(),
  sep: '-',
  format: 'DD-MM-YYYY',
  exclude: { year: false, month: false, day: false, zero: false },
  nameOfMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
  weekDays: {
    set: true,
    locale: 'en',
    format: 'short',
    case: 'uppercase',
    position: 'end'
  },
  incDay: 1
});

console.log(formattedDate);  // Outputs something like: "15-JAN-2023 SUN"

Time Formatting

Formatting time is straightforward as well:

import { getFormattedTime } from 'tictic'

const formattedTime = getFormattedTime({
  time: new Date().getTime(),
  sep: ':',
  format: 'hh:mm:ss 12h'
});

console.log(formattedTime);  // Outputs something like: "01:45:20 PM"

API Reference

For a deep dive into each method and its options, please refer to the source code documentation. It provides clear details about each configuration property and its possible values.

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See LICENSE.md for more details.

1.0.0

6 months ago

0.2.20

6 months ago

0.2.19

6 months ago

0.2.18

6 months ago

0.2.16

6 months ago

0.2.10

6 months ago

0.2.5

6 months ago

0.2.4

6 months ago

0.2.3

6 months ago

0.2.2

6 months ago

0.2.1

6 months ago

0.2.0-beta1

7 months ago

0.2.0-beta0

7 months ago

0.1.2-beta8

7 months ago

0.1.2-beta7

7 months ago

0.1.2-beta6

7 months ago

0.1.2-beta5

7 months ago

0.1.2-beta4

7 months ago

0.1.2-beta3

7 months ago

0.1.2-beta2

7 months ago

0.1.2-beta1

7 months ago

0.1.2-beta

7 months ago

0.1.1

7 months ago

0.1.0

7 months ago

0.0.1

7 months ago