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
Add Request day().add(object) #575
Comments
Exact the same with above line? |
@xxyuk the first one im using moment, trying to use dayjs instead |
Yes, we could support this as a plugin to add a time object. |
Having the same issue with this |
dayjs doesnt let you set an object |
What's the best name for these two plugins?
|
AdvancedGet AdvancedSet |
etc... |
But add && subtract is actually the same function, so there's no need adding two separate |
You can do AdvancedAddSubtract |
Can you hit me up when you add them please so i can close this issue |
Sure. You could do |
wow i didnt know that you can do that lol |
can i do the same with .set |
I did something like this for the .add |
@iamkun is it possible i can do this endTime = day(df.endTime, 'HH:mm:ss'); instead of endTime = moment(df.endTime, 'HH:mm:ss'). Doing it right now will return NAN |
yes, |
i have it added but its not doing anything |
do i have to do something like day.customParseFormat() |
online demo or sample code, please. |
@iamkun hope this helps |
drf.endtime should always equal something like 12:04 |
I think i got it, im sending in a a time that doesnt have seconds, its breaking it. In moment, if the time doesnt have seconds, it automatically add the seconds to the time :00 |
We just released the ObjectSupport plugin to support this. https://day.js.org/docs/en/plugin/object-support |
Describe the bug
Hi,
I kind of like this project, I'd like to use it to add an object instead of just using add(value: number, unit: string). I was using moment before but im moving into using dayjs because its way smaller.
Expected behavior
const maxTimestamp = moment(this.endDate.value.valueOf()) .utc() .startOf('day'); maxTimestamp.add({ hours: minTime.slice(0, 2), minutes: minTime.slice(3, 5) });
Trying to switch that into:
const maxTimestamp = day(this.endDate.value.valueOf()) .utc() .startOf('day'); maxTimestamp.add({ hours: minTime.slice(0, 2), minutes: minTime.slice(3, 5) });
Information
The text was updated successfully, but these errors were encountered: