date-fns-reactified

date-fns but for vue composition-api


Keywords
date-fns, reactify, vue, vueuse, composition api
License
MIT
Install
npm install date-fns-reactified@0.1.2

Documentation

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.