Skip to content

mjm1374/tardis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tardis

A simple time date converter and formatter supporting Unix timestap and ISO 8601

Install

Include tardis.js in your build or link to it from you html

Usage

 
const tardis = require('lbx-tardis')
 

const getDate = tardis.dateparts() // { year: 119, month: 6, day: 29, hour: 13, min: '04', sec: '12', fullYear: 2019, shortYear: '19', wordYear: 'two thousand and nineteen',  fullMonth: 'June',  shortMonth: 'Jun',....}

const getISO = tardis.ISO() // 2019-06-29

const getTimeStamp = tardis.patterned(1133481000, 'M/DD/YYYY - H:I:s TT tt'); // { pattern: '12/02/2005 - 18:50:{{26}} PM pm', time: 1133481000 }

const getTime = tardis.patterned('2019-06-29T17:26:43', 'M/DD/YYYY - HH:II:SS tt'); //{ pattern: '6/30/2019 - 18:26:43 pm', time: '2019-06-29T17:26:43' }

Full filter patterns here and presets

Contributing

In case you notice a bug, please open an issue mentioning the input that has caused an incorrect conversion.

Authors

  • Mike McAllister - Initial work - mjm1374

Acknowledgments

About

a simple time date converter and formatter

Resources

License

Stars

Watchers

Forks

Packages

No packages published