A plugin for Vuex-ORM that adds a `date` attribute type to model fields, automatically converting string/number values to JavaScript Date objects. Current stable version is 0.1.1. The plugin extends Vuex-ORM's field definition API with `this.date()` and handles serialization/deserialization. It is lightweight and has no runtime dependencies beyond Vuex-ORM. Unlike manual field transforms, it provides a declarative way to handle date attributes within Vuex-ORM's data layer.
npm install vuex-orm-plugin-date-attributeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates plugin installation, model definition with this.date(), and automatic Date conversion.
Always use `this.date()` within the static `fields()` method of your Model subclass.
Override `$toJson()` on your model if custom serialization is needed.
Use a library like `date-fns-tz` if you need time zone handling.
Call `VuexORM.use(datePlugin)` before any model definition that uses `this.date()`.
Ensure `VuexORM.use(datePlugin)` is called. Verify `this.date()` is inside a `static fields()` method.
Check that `@vuex-orm/core` is installed and imported, and that the plugin is passed to `VuexORM.use()` correctly.