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

feat(daterangepicker): add ability to select week as a daterange #5611

Merged
merged 4 commits into from
Feb 3, 2020

Conversation

daniloff200
Copy link
Contributor

@daniloff200 daniloff200 commented Jan 22, 2020

closes #5588

PR Checklist

Before creating new PR, please take a look at checklist below to make sure that you've done everything that needs to be done before we can merge it.

  • read and followed the CONTRIBUTING.md guide.
  • built and tested the changes locally.
  • added/updated tests.
  • added/updated API documentation.
  • added/updated demos.

@codecov
Copy link

codecov bot commented Jan 22, 2020

Codecov Report

Merging #5611 into development will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##           development    #5611   +/-   ##
============================================
  Coverage        52.52%   52.52%           
============================================
  Files                3        3           
  Lines               99       99           
  Branches            17       17           
============================================
  Hits                52       52           
  Misses              37       37           
  Partials            10       10

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 6e594b1...9b8d8a8. Read the comment docs.

@daniloff200 daniloff200 force-pushed the week-daterange-select-5588 branch 2 times, most recently from 5eec928 to a611cc7 Compare January 23, 2020 09:59
@daniloff200 daniloff200 requested a review from valorkin January 23, 2020 10:03
@daniloff200 daniloff200 changed the title feat(daterangepicker): add ability to select week as a daterange [WIP] feat(daterangepicker): add ability to select week as a daterange Jan 23, 2020
@daniloff200 daniloff200 force-pushed the week-daterange-select-5588 branch 2 times, most recently from ebc2d0b to 5533c2d Compare January 23, 2020 10:49
@daniloff200 daniloff200 force-pushed the week-daterange-select-5588 branch from 5533c2d to d212b67 Compare January 23, 2020 11:38
@@ -1044,7 +1044,12 @@ export const ngdoc: any = {
{
"name": "selectWeek",
"type": "boolean",
"description": "<p>Makes dates from other months active</p>\n"
"description": "<p>Makes weeks selectable, and mark first available date of the week as selected</p>\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you generate this code or add it manually?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, previously that was added manually, now I used demo.gen-docs script

if (week.days.length === 0) {
return;
if (this._config.selectWeek) {
if (week.days
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please merge these conditions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

@daniloff200 daniloff200 force-pushed the week-daterange-select-5588 branch from e4d70fd to 6dc1d33 Compare January 28, 2020 09:47
Copy link
Member

@valorkin valorkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@dmitry-zhemchugov
Copy link
Contributor

Tested ready to merge

Copy link
Contributor

@dmitry-zhemchugov dmitry-zhemchugov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to merge

@daniloff200 daniloff200 merged commit e65bf65 into development Feb 3, 2020
@delete-merged-branch delete-merged-branch bot deleted the week-daterange-select-5588 branch February 3, 2020 15:11
@Vinoth-deva
Copy link

How to Implement this? ability to select Week

@daniloff200
Copy link
Contributor Author

@Vinoth-deva I don't understand your question.
Do you want to ask, how to use this functionality in your project, or what?

@Vinoth-deva
Copy link

@Vinoth-deva I don't understand your question.
Do you want to ask, how to use this functionality in your project, or what?

Yes, Thank you so much for the reply, @daniloff200 i want to know how to use this functionality in my project

@daniloff200
Copy link
Contributor Author

@Vinoth-deva
Copy link

Vinoth-deva commented Aug 12, 2020

i had a look into it, there if we select the week number its selecting first day of the week, but in my case if user select any of the day i want to select the entire week @daniloff200 as shown in the XD
weekRangeSelector

@daniloff200
Copy link
Contributor Author

Well, we don't have such functionality, but, you can try to use a workaround.
We have ability to use daterangepicker with a one month only showing, check https://valor-software.com/ngx-bootstrap/#/datepicker#display-one-month
Also, when user selects a date, you have to programatically find out, for what daterange this date belongs to, for example, if it 14th July, that should be 07/12/2020 - 07/18/2020, and, range will be selected

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

Successfully merging this pull request may close these issues.

feat(datepicker): selectWeek returns whole week
5 participants