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

Add colors datepicker, focus day when navigating #533

Merged

Conversation

tbille
Copy link
Contributor

@tbille tbille commented Jul 10, 2017

Proposition for this issue: #513

Add grey color to the week-ends and yellow color to the current day (today).

selection_008

Bug fix: when changing month the selected day was the same as the current day. For example if the current day is 10th of July, when I changed month it was focusing the 10th of August.

This is fixed, now the first day of the month and the week is selected.

Tests: This pull-requests adds the missing tests on the DatepickerController.

@mention-bot
Copy link

@tbille, thanks for your PR! By analyzing the history of the files in this pull request, we identified @georgehrke, @raghunayyar and @tcitworld to be potential reviewers.

@georgehrke
Copy link
Member

@tbille Thx a lot for this pull request! :)

Looks really cool! 🎉 :)

Add grey color to the week-ends and yellow color to the current day (today).

👍 As discussed in the issue

when changing month the selected day was the same as the current day.

This was actually the expected behavior for me, but let's open this up for discussion.
cc @jancborchardt @tcitworld

This pull-requests adds the missing tests on the DatepickerController.

Awesome! Much appreciated.

#datepicker table tbody tr.uib-weeks td:last-child button {
background-color: rgba(240, 240, 240, .9);
Copy link
Member

Choose a reason for hiding this comment

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

I didn't test this yet, but I think this will only work for US. What if you set your locale e.g. to german, where the week starts on monday? I guess Monday and Sunday will be shown a little darker

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, my work environment is set in US. This should be changed to work also with an European environment.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this approach will work for both locales.

Maybe we have to add another class to the date picker element, that says whether the week starts on Sunday or Monday.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok it can be done in the function getDayClass of the datepickerController

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, now a class is added for everyday weekend days: weekendHilight

@tbille tbille force-pushed the add-colors-and-focus-day-datepicker branch from 4b14da6 to c3475b3 Compare July 10, 2017 22:08
@georgehrke georgehrke added the 3. to review Waiting for reviews label Jul 11, 2017
@jancborchardt
Copy link
Member

This was actually the expected behavior for me, but let's open this up for discussion.

Yeah, I’d also say it’s expected behavior.

Great work @tbille! :)

@jancborchardt
Copy link
Member

Just one point of feedback: In that datepicker there instead of giving the weekend full grey background, I would rather grey out the numbers. Otherwise it’s way too much visual load. :)

@@ -89,6 +89,14 @@
border-left: 0;
}

.todayHilight {
Copy link
Member

Choose a reason for hiding this comment

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

Also please use class naming like: .highlight-today and .highlight-weekend. :)

@jancborchardt
Copy link
Member

jancborchardt commented Jul 12, 2017

I was working on a new datepicker design and since I made sure it works with the calendar datepicker too, how about we use the same design there?

See nextcloud/server#5691 (comment)
datepicker
(circles should be round of course, it’s a rough mockup ;)
It would work exactly the same in the top left of the Calendar app navigation. Takes away all the extra lines and cruft, and makes the design a lot more modern, like the rest of Nextcloud. :)

@georgehrke georgehrke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jul 13, 2017
@tbille tbille force-pushed the add-colors-and-focus-day-datepicker branch from c3475b3 to cd92ac9 Compare July 15, 2017 13:03
@tbille
Copy link
Contributor Author

tbille commented Jul 15, 2017

@jancborchardt I applied your mockup on the datepicker, here how it looks like:

When not visible:
selection_009

When visible:
selection_010

Shall we apply the same style for the buttons month/weeks/day?

@jancborchardt
Copy link
Member

Very nice! Looks good and I'd merge it. Cc @pixelipo since he just works on the date picker in core.

The week/month/today buttons should stay like this. :)

@pixelipo
Copy link

Looks great! I've only got two comments:

  • header should not be bold (same as core version)
  • today date would look better (and have better contrast) with a white font

@jancborchardt
Copy link
Member

Right, agree with @pixelipo. Also, the selected date font should be bold. :)

@tbille tbille force-pushed the add-colors-and-focus-day-datepicker branch from cd92ac9 to c86235e Compare July 16, 2017 10:42
@tbille
Copy link
Contributor Author

tbille commented Jul 16, 2017

@jancborchardt @pixelipo WDYT?

  • header should not be bold (same as core version)
  • today date would look better (and have better contrast) with a white font
  • the selected date font should be bold

selection_011

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Great stuff! :)

@@ -89,27 +89,35 @@
border-left: 0;
}

#datepicker table tbody tr.uib-weeks td:last-child button {
border-right: none;
.today-hilight {
Copy link
Member

Choose a reason for hiding this comment

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

Just one thing: Can you use the class exactly as I said in my previous comment:

.highlight-today

(Proper english and also the correct order, as we use .highlight-weekend too)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

color: #c7c7c7;
}

.weekend-hilight button {
Copy link
Member

Choose a reason for hiding this comment

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

Same here, please call the class

.highlight-weekend

(Proper english and also the correct order, as we use .highlight-today too)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}

#datepicker table tbody button {
max-width: 34px; /* Hack for Firefox for overflowing tables */
}

#datepicker table tbody button.active {
background-color: rgba(240, 240, 240, .9);
border-radius: 50%;
background-color: #0082c9;
Copy link
Member

Choose a reason for hiding this comment

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

@skjnldsv Can apps use scss too?

Choose a reason for hiding this comment

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

Yes, they can.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they should :) , but it should be in another issue.

It would be much easier to 'debug css' and to adapt the apps to the nextcloud themes

Choose a reason for hiding this comment

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

@georgehrke we migrated Deck to SCSS recently: nextcloud/deck#219

Copy link
Member

@georgehrke georgehrke Jul 17, 2017

Choose a reason for hiding this comment

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

@georgehrke we migrated Deck to SCSS recently: nextcloud/deck#219

This looks wrong, because it doesn't use the scss engine from the Nextcloud server. Hence it won't update the CSS when the admin changes the theme

Nevermind

Copy link
Member

Choose a reason for hiding this comment

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

they should :) , but it should be in another issue.

Yes :)

I would vote to merge this now and fix the scss / primary color issue in a follow up PR :)

@tbille tbille force-pushed the add-colors-and-focus-day-datepicker branch from c86235e to 3b13b7c Compare July 16, 2017 23:55
@@ -89,27 +89,35 @@
border-left: 0;
}

#datepicker table tbody tr.uib-weeks td:last-child button {
border-right: none;
.hilight-today {

Choose a reason for hiding this comment

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

As mentioned previously by @jancborchardt - this should be .highlight-today (spelling)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

small mistake.
Done

color: #c7c7c7;
}

.hilight-weekend button {

Choose a reason for hiding this comment

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

As mentioned previously by @jancborchardt - this should be .highlight-weekend (incorrect spelling)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Thomas Bille <contact@tbille.fr>
@tbille tbille force-pushed the add-colors-and-focus-day-datepicker branch from 3b13b7c to 2164127 Compare July 17, 2017 10:01
@georgehrke georgehrke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jul 17, 2017
@georgehrke georgehrke dismissed jancborchardt’s stale review July 18, 2017 16:03

Very nice! Looks good and I'd merge it. (#533 (comment))

@georgehrke georgehrke merged commit ccb7aab into nextcloud:master Jul 18, 2017
@tbille tbille deleted the add-colors-and-focus-day-datepicker branch July 18, 2017 16:09
@jancborchardt
Copy link
Member

Great work everyone, our new datepicker is awesome! :)

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

Successfully merging this pull request may close these issues.

6 participants