Skip to content
Advertisement

Tag: luxon

Luxon fromFormat pattern ignore time

When I try to create Date object from string format in Luxon I get invalid date. Hours and minutes are not passed. This gives me an Invalid date Using moment library it seems that if hours and minutes are not passed it defaults to 00:00:00 Is there some option to format both formats with hours and without in Luxon using

Obtain Duration of a quarter in Luxon

I’m trying to obtain the Duration (or start and end dates) of an arbitrary ‘quarter’ in Luxon. For example, suppose I want the beginning and ending dates of the 3rd quarter knowing only the quarter: This will give me the start date of the quarter, but how can I obtain the end date as well. I’ve looked into Durations and

Formatting ISO time with Luxon

Using Luxon JS, I’ve been trying to format datetime to output in a certain format, using the native toISO function: This is what I get: And this is what I want: I know that they are both equivalent in terms of unix time and mean the same thing except in a different format, I just want to be able to

How to get date range from week number with Luxon

I’m searching a way to get date range from week number with Luxon to replace my ‘moment’ code. Today I’m using this code: I found a way to do that from a month number with ‘DateTime.fromObject()’ but that’s doesn’t work with ‘week’. So I don’t find the best way to do that from a week number 🙁 Thank’s in advance.

Luxon is failing to parse this date format

I’m trying to figure out why luxon is failing to parse this date format. This is the original value I have: 2019-04-23T23:15:07.910Z. What format is this (it looks like an iso format). Code snippet: Output from snippet above: Answer Ahh just figured it out. Turns out 2019-04-23T23:15:07.910Z is actually a javascript date object. This means I needed to do const

Advertisement