date-fns-reactified

v0.1.2
date-fns but for vue composition-api
date-fns reactify vue vueuse composition api

date-fns-reactified

npm GitHub Workflow Status Code Climate maintainability Code Climate coverage libraries.io npm GitHub license

This is meant as a replacement of date-fns for vue.js composition api with Ref<>. It uses reactify from @vueuse/core all over the place.

Installation

npm i date-fns-reactified

Usage

instead of:

import { addDays } from 'date-fns';
import { ref } from 'vue-demi';

const date = ref(new Date());
const days = ref(7);

const newDate = addDays(date.value, days.value)

do this:

import { addDays } from 'date-fns-reactified';
import { ref } from 'vue-demi';

const date = ref(new Date());
const days = ref(7);

const newDate = addDays(date, days)

Testing

Simply run npm test and all your tests in the test/ directory will be run. It has full support for Visual Studio Code. You can use the debugger to set breakpoints.

License

Licensed under the MIT license.

npm i date-fns-reactified

Metadata

  • MIT
  • Whatever
  • fratzinger
  • released 1/3/2022

Downloads

Maintainers