Skip to content

DASPRiD/mikro-orm-js-joda

Repository files navigation

JS Joda for Mikro ORM

Release

This package provides Mikro ORM types for common JS Joda objects.

The library exports the following types:

  • LocalDateType
  • LocalTimeType
  • ZonedDateTimeType

It is not handling LocalDateTime at the moment, as that type is very platform dependent and Mikro ORM does not come with a declaration in its platform drivers.

Supported peer dependencies

At the moment, you need to have a recent version of @js-joda/core^5.6.1 and @mikro-orm/core@^6.0.5. Support for future major releases will be added as needed.

Installation

npm

npm i mikro-orm-js-joda

pnpm

pnpm add mikro-orm-js-joda

Usage

import type { ZonedDateTime } from '@js-joda/core';
import { ZonedDateTimeType } from 'mikro-orm-js-joda';
import { Entity, Property } from "@mikro-orm/core";

@Entity()
export class HelloWorld {
    @Property({type: ZonedDateTimeType})
    public dateTime: ZonedDateTime;
}