1.0.3 • Published 3 years ago

strftime-format v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years 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

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

2.0.0

3 years ago

1.0.0

3 years ago