Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'now' does not exist on type 'typeof DateTime'. #1598

Open
siberry opened this issue Mar 8, 2024 · 1 comment
Open

Property 'now' does not exist on type 'typeof DateTime'. #1598

siberry opened this issue Mar 8, 2024 · 1 comment

Comments

@siberry
Copy link

siberry commented Mar 8, 2024

Describe the bug
I am using Luxon DateTime with Typescript and am having no other type errors except for when using DateTime.now() I am getting the type error Property 'now' does not exist on type 'typeof DateTime'.

To Reproduce
When using Typescript:

DateTime.now()

Actual vs Expected behavior
DateTime.now would not throw a type error

Desktop (please complete the following information):

  • OS: macOS 14.3.1
  • Editor - VS Code
  • Luxon version 3.4.4
@tzaitsev-rl
Copy link

tzaitsev-rl commented Mar 27, 2024

@siberry I saw this as well, do you happen to be using ES6 modules?

import DateTime from "luxon"; 
// or import * as DateTime from "luxon";
//requires you to write DateTime.Datetime.now()
import { DateTime } from "luxon";
//requires you to write DateTime.now()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants