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

Query method supports Dayjs constructor args #74

Closed
wants to merge 1 commit into from
Closed

Query method supports Dayjs constructor args #74

wants to merge 1 commit into from

Conversation

huihuimoe
Copy link
Contributor

like momentjs, it supports
dayjs().isAfter("2020") is now after 2020years
dayjs().isBefore("2000-4-1") is now before 2000-4-1

@codecov-io
Copy link

codecov-io commented Apr 29, 2018

Codecov Report

Merging #74 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #74   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           3      3           
  Lines         175    175           
  Branches       27     30    +3     
=====================================
  Hits          175    175
Impacted Files Coverage Δ
src/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9742a62...01a568b. Read the comment docs.

@iamkun
Copy link
Owner

iamkun commented May 2, 2018

Not sure if we need this. Simply you can do dayjs().isAfter(dayjs('2020-01-01')) to meet your need.

Pending... , waiting for opinions.

@iamkun iamkun added the discussion Further discussion label May 3, 2018
@devshawn
Copy link

devshawn commented May 7, 2018

For some input, I'd likely agree with @iamkun's suggestion here of not needing it... fairly easy to just make a new dayjs object with your second date for comparisons.

@huihuimoe
Copy link
Contributor Author

huihuimoe commented May 11, 2018

for my opinion, to make a new dayjs object to call a method is a nagging operation.
I have found the dayjs .diff method also can call by dayjs constructor argument.
just like jquery and zeptojs, why not use $('header').find('nav') instead of $('header').find($('nav')) ?

and it is not pretty to make numbers of dayjs object in calling arguments.

@iamkun
Copy link
Owner

iamkun commented May 30, 2018

@huihuimoe Finally, agreed with you. But I'm afraid this pr is too old to get merged.

Would you please make a new pr? With the code only will be fine. I'll do the docs together.

Thanks

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

Successfully merging this pull request may close these issues.

4 participants