0.0.1 • Published 4 months ago

cdate-schedule v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

cdate-schedule

This is a cdate plugin for schedule format.

Build Status

Usage

import { cdate } from 'cdate'
import { plugin } from 'cdate-schedule'

const date = cdate().plugin(plugin).scheduleFn()

const now = Date.now

console.log(date(new Date(now)).schedule())
// Today 11:00 AM

const lastWeek = new Date(now.getFullYear(), now.getMonth(), now.getDate()-7)
console.log(date(lastWeek).schedule())
// Last Wednesday 11:01 AM

const nextWeek = new Date(now.getFullYear(), now.getMonth(), now.getDate()+5)
console.log(date(nextWeek).schedule())
// Next Monday 11:02 AM

Author

@linyows

0.0.1

4 months ago