{"id":12530,"library":"vue-momentjs","title":"Vue 1.x Moment.js Wrapper","description":"This package, `vue-momentjs` v1.0.0, serves as a lightweight wrapper for the Moment.js library, designed specifically for applications built with Vue.js version 1.x. It simplifies integrating Moment.js functionalities into Vue components by exposing a `$moment()` instance. Released approximately six years ago and last updated around that time, the package is now considered abandoned. Its core dependency, Moment.js, has been in maintenance mode since September 2020 and is not recommended for new projects due to concerns regarding bundle size, object mutability, and modern JavaScript ecosystem compatibility. Furthermore, Vue 1.x has reached its end-of-life, making `vue-momentjs` incompatible with modern Vue 2.x or Vue 3.x applications. Users requiring date manipulation in current Vue projects should consider actively maintained alternatives like Day.js, Luxon, or `date-fns` with dedicated Vue 2/3 integrations.","status":"abandoned","version":"1.0.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/KarboniteKream/vue-momentjs","tags":["javascript","vue","moment","wrapper"],"install":[{"cmd":"npm install vue-momentjs","lang":"bash","label":"npm"},{"cmd":"yarn add vue-momentjs","lang":"bash","label":"yarn"},{"cmd":"pnpm add vue-momentjs","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency for date and time manipulation. Note: Moment.js is a deprecated library.","package":"moment","optional":false},{"reason":"Peer dependency for the Vue.js framework. Note: This package targets Vue 1.x, which is End-of-Life.","package":"vue","optional":false}],"imports":[{"note":"The primary way to import the plugin for ES Modules. It is likely a default export.","wrong":"import { VueMomentJS } from 'vue-momentjs';","symbol":"VueMomentJS","correct":"import VueMomentJS from 'vue-momentjs';"},{"note":"CommonJS import for Node.js environments. Given the package's age, this might have been the primary method initially.","wrong":"const { VueMomentJS } = require('vue-momentjs');","symbol":"VueMomentJS","correct":"const VueMomentJS = require('vue-momentjs');"},{"note":"After installation via `Vue.use(VueMomentJS, moment)`, the Moment.js instance is available globally on Vue components as `this.$moment`.","symbol":"$moment","correct":"this.$moment().format('LLL');"}],"quickstart":{"code":"import Vue from 'vue';\nimport moment from 'moment';\nimport VueMomentJS from 'vue-momentjs';\n\n// Install the plugin, passing the Moment.js library instance\nVue.use(VueMomentJS, moment);\n\n// Create a basic Vue component\nconst app = new Vue({\n  el: '#app',\n  data: {\n    message: 'Hello Vue with Moment.js!'\n  },\n  mounted() {\n    // Use this.$moment() to access Moment.js functionalities\n    console.log('Current time:', this.$moment().format('MMMM Do YYYY, h:mm:ss a'));\n    this.message = `Current time: ${this.$moment().format('MMMM Do YYYY, h:mm:ss a')}`;\n  },\n  template: `\n    <div>\n      <h1>{{ message }}</h1>\n      <p>Formatted date from instance: {{ this.$moment('2023-01-15').format('dddd, MMMM Do YYYY') }}</p>\n    </div>\n  `\n});\n\n// Ensure you have a div with id='app' in your HTML:\n// <div id=\"app\"></div>\n","lang":"javascript","description":"Initializes `vue-momentjs` with Moment.js and demonstrates basic date formatting within a Vue 1.x component."},"warnings":[{"fix":"Migrate to a modern date library (e.g., Day.js, Luxon, date-fns) and integrate it with a compatible Vue 2/3 wrapper or a custom composition API setup.","message":"This package is designed for Vue 1.x and is incompatible with Vue 2.x or Vue 3.x due to significant API changes in newer Vue versions, including the removal of global Vue instance methods for plugin installation in Vue 3.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Avoid using Moment.js in new projects. Consider modern alternatives like Day.js, Luxon, or date-fns, which are actively maintained and designed for modern JavaScript ecosystems.","message":"The underlying `moment` library is in maintenance mode and not recommended for new projects. It will not receive new features and has known issues with bundle size and object mutability.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Discontinue use in production for any new development. Existing projects should assess the risk of using unmaintained software and consider migration.","message":"The `vue-momentjs` package itself appears unmaintained, with its last publish date being approximately six years ago. This suggests a lack of support, bug fixes, or security updates.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure `Vue.use(VueMomentJS, moment);` is called before instantiating Vue components and that `moment` is properly imported and passed as an argument.","cause":"The `vue-momentjs` plugin was not correctly installed via `Vue.use(VueMomentJS, moment);` or Vue is not an active instance.","error":"TypeError: this.$moment is not a function"},{"fix":"This package is not compatible with Vue 3. You must use a Vue 3 compatible date library and its corresponding plugin or integrate directly.","cause":"The global `Vue.use` method was removed in Vue 3. Plugin installation is now done on the application instance (e.g., `createApp().use(plugin)`). This package is only compatible with Vue 1.x.","error":"Vue.use is not a function (when using Vue 3)"},{"fix":"Ensure you have `import moment from 'moment';` at the top of your file and that `moment` is listed as a dependency in your `package.json` and installed.","cause":"The `moment` library was not imported or made globally available before `vue-momentjs` attempted to use it.","error":"Uncaught ReferenceError: moment is not defined"}],"ecosystem":"npm"}