get-md-date
get date from markdown article
Install
npm install --save get-md-date
Usage
; const input = `# title 21 asd qwe 22 *Dec* 2015 23 December 2015 24 Décembre 2015`; text; // 21 Dec 2015html; // 22 <em>Dec</em> 2015unix; // 1450645200000text; // 23 December 2015text; // 24 Décembre 2015moment; // moment instancenode; // AST node, see commonmark API; // undefined ¯\_(ツ)_/¯
API
getDate(format, locale, input)
format
Required
Type: String
Momentjs format for date, e.g. DD MMMM YYYY
.
locale
Required
Type: String
One of 83 available in momentjs locales, e.g. en
or fr
.
input
Required
Type: String
Markdown string.
Related
- get-md-content - get content from markdown article
- get-md-desc - get description from markdown article
- get-md-image - get image from markdown article
- get-md-title - get title from markdown article
License
MIT © Vladimir Starkov