pactum icon indicating copy to clipboard operation
pactum copied to clipboard

Date Utils

Open ASaiAnudeep opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. It would be great to have a inbuilt date manipulating functions like momentjs or luxon

Describe the solution you'd like

const { date } = require('pactum');

date.now();
date.now().add({ days: 2});
date.now().minus({ hours: 2}).format('dd MM yyyy');

ASaiAnudeep avatar Jun 13 '22 13:06 ASaiAnudeep

In javascript world, I think dayjs (website) is better, and the size of this library is 2kb after zipping.

As the momentjs, it doesn't upgrade for long time, and it suggest users to use dayjs as a replacement.

However, as for me, if I need to format some Date structure, I just do import dayjs from 'dayjs'.

So, In my opinion, maybe there is no need to implement patcum with some Date library

wine-fall avatar Aug 14 '23 09:08 wine-fall