
Security News
pnpm 10.12 Introduces Global Virtual Store and Expanded Version Catalogs
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
vue3-dayjs-plugin
Advanced tools
A wrapper for integrating Day.js into Vue.js 3
Day.js is a minimalist JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers with a largely Moment.js-compatible API. If you use Moment.js, you already know how to use Day.js.
This plugin allows you to easily include Day.js globally. This is not recommended with Vue 3, and they recommend using provide/inject instead. But if you're just getting started with Day.js or know you prefer it global, you can use this plugin to make your coding life a bit easier.
npm install vue3-dayjs-plugin
import VueDayjs from 'vue3-dayjs-plugin'
Vue.use(VueDayjs) // in your createApp call
Day.js will be available in your Vue templates using $date or $dayjs.
// you can call like this when using the old syntax
this.$date('2018-08-08').format('DD/MM/YYYY');
// when using the new <script setup> syntax you have to bring Day.js in manually
// this means import Day.js into the script yourself or you can use the useDate composable included with this package.
import { useDate } from 'vue3-dayjs-plugin/useDate';
<script setup>
const date = useDate();
// then anywhere you need to use Day.js
date('2018-08-08').format('DD/MM/YYYY');
</script>
// this is because global properties are not accessible within <script setup> :(
<!-- this method of using Day.js ($date or $dayjs) will be globally available in all your components -->
<div>{{ $date('2023-04-12').format('DD/MM/YYYY') }}</div>
<div>{{ $dayjs('2023-04-12').format('DD/MM/YYYY') }}</div>
FAQs
A wrapper for integrating dayjs into Vuejs 3
The npm package vue3-dayjs-plugin receives a total of 280 weekly downloads. As such, vue3-dayjs-plugin popularity was classified as not popular.
We found that vue3-dayjs-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.