Skip to main content
2 votes
1 answer
129 views

I use this package and my function is this: const formatDate = ( date: string | Date, dateFormat: string = 'PP p', timezone?: string, ) => { const zoneDate = toZonedTime(date, timezone ?? '...
Torben's user avatar
  • 5,552
1 vote
1 answer
54 views

I am replacing moment with date-fns in my Ionic Angular project. I run with many possible languages, so did not want to statically import them all, and make the bundle bigger. I am trying the ...
peterc's user avatar
  • 7,983
0 votes
1 answer
60 views

I was messing about with the minDate prop on the MUI X Date Picker (specifically the DatePicker component). I was trying to set the minDate to a date with a negative year (i.e. a BCE year) in order to ...
louisch's user avatar
  • 316
0 votes
0 answers
48 views

Here's the code to reproduce it: import timezoneMock from 'timezone-mock'; import { utc } from '@date-fns/utc'; it('breaks', () => { timezoneMock.register('US/Eastern') const now = new Date(); ...
AncientSwordRage's user avatar
0 votes
1 answer
33 views

When using date-fns, how can I use intlFormatDistance such that for a duration less than 24 hours, it displays "today" or "yesterday", instead of "x hours ago". Example: ...
Ben's user avatar
  • 16.8k
1 vote
2 answers
307 views

In my Rails 8 app I'm using Importmap and I would like to use date-fns in an appropriate manner given only one functionality and a couple of locales from that JS library are needed. Below is what I ...
user502052's user avatar
  • 15.3k
0 votes
2 answers
77 views

I am using the date-fns library to get the months between a couple of date values using the eachMonthOfInterval function, like so: const startingMonth = "2024-10-01 00:00:00"; const ...
Harish's user avatar
  • 528
0 votes
0 answers
38 views

Having a strange issue using date-fns with react. Didn't encounter anything like this before. Basically there is a component which gets a year number as a prop, which is then used to create a date ...
Hayk Safaryan's user avatar
0 votes
1 answer
50 views

I use the date-fns library to work with dates. the code provided their methods. prisma: 5.22.0 @prisma/client: 5.22.0 async getAllOnYear() { const date = new Date() const startYear = ...
Mezantrop's user avatar
1 vote
0 answers
36 views

The DST timing is wrong in countries where DST starts at 12 a.m., such as (Lebanon ,Cuba, Egypt). The library we're utilizing for UTC dates Package version: date-fns: 2.30.0, date-fns-tz: 1.3.8. ...
shaily rajput's user avatar
0 votes
0 answers
61 views

I have a set of code running that checks two dates. If those two dates/times occurred on the same day, one course of action is taken. If they are not, a different set of components are shown. The code ...
Joshua Foxworth's user avatar
0 votes
2 answers
967 views

I have been using the date-fns function "isSameDay" to test if two actions take place on the same day. The function is given two standard javascript date objects. We recently found a bug ...
Joshua Foxworth's user avatar
1 vote
1 answer
2k views

I use Angular Material 18 and the Datepicker component. I try to use the local variation and try to avoid moment. The reason for this is that moment is deprecated. There I try use the DateFns ...
LeO's user avatar
  • 5,401
0 votes
1 answer
464 views

I am trying to add a custom calender header for the MUI Date Picker component but am running into troubles when changing the default dayjs type to date-fns. Here is my Date Picker component and custom ...
Dov Royal's user avatar
1 vote
2 answers
1k views

I'm trying to use the format function of the Node.js module date-fns. Some info about my system (obtained by the command ng --version) is reported below: Angular CLI: 13.2.0 Node: 16.13.2 Package ...
User051209's user avatar
  • 2,658

15 30 50 per page
1
2 3 4 5
35