1.0.3 • Published 1 year ago

strftime-format v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

strftime-format

Takes in a Date object and a string and replaces all strftime C-type time variables in the string with the corresponding data from the Date object.

Installation

yarn add strftime-format

Syntax

strftimeFormat(date, string);
strftimeFormat(date, string, locale);

Parameters

date

A Date object

string

A string containing strftime C-type time variables. List of supported variables here: https://strftime.org/

locale (optional)

A locale string

Example

import strftimeFormat from 'strftime-format';

const date = new Date();

const dateString = strftimeFormat(date, '%A %-d. %B, %Y');
const germanDateString = strftimeFormat(date, '%A %-d. %B, %Y', 'de-DE');
1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

2.0.0

1 year ago

1.0.0

1 year ago