1.8.0 • Published 2 years ago

@badosz/utils v1.8.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@badosz/utils

Utility functions I often find myself using in different projects

Installation

$ npm install @badosz/utils

OR

$ yarn add @badosz/utils

Usage

import { Time } from '@badosz/utils'

const weekend = Time
  .in(4, 'days')
  .add(2, 'weeks')
  .subtract(4, 'minutes')
  .isWeekend()

const greater = new Time().gt(Time.subtract(Time.in(4, 'days'), 8, 'weeks'))


const date = Time.in(-400_00)
const twoWeeksBetween = Time.between(Time.add(date, 4000), date) > Time.Units.WEEK * 2
const twoWeeksSince = Time.since(date) > Time.Units.WEEK * 2

License

MIT

1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.2.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago