date-fns-reactified
v0.1.2
Published
date-fns but for vue composition-api
Downloads
1,630
Maintainers
Readme
date-fns-reactified
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.