# Core Graphics Tutorial Part 2: Gradients and Contexts

**URL:** <https://forums.kodeco.com/t/core-graphics-tutorial-part-2-gradients-and-contexts/6559>\
**Category:** 🎓 Courses & Articles\
**Created:** [March 4, 2016, 10:51am UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-2-gradients-and-contexts/6559 "2016-03-04T10:51:20Z")\
**Posts on this page:** 1\
**Page:** 4

<div class="post-metadata">

**Author:** ![aaronh](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/aaronh/32/70080_2.png) [@aaronh](https://forums.kodeco.com/u/aaronh)\
**Post date:** [July 9, 2017, 8:17pm UTC](https://forums.kodeco.com/t/core-graphics-tutorial-part-2-gradients-and-contexts/6559/66 "2017-07-09T20:17:41Z")

</div>

Just to make things easier for people in the future, in Swift 3 you can get the day of the week in much simpler way. Instead of all the dateFormatter and Calendar lines at the beginning of that section you can use the following single line.

`var weekday = Calendar.current.component(.weekday, from: Date())`

[Previous page](https://forums.kodeco.com/t/core-graphics-tutorial-part-2-gradients-and-contexts/6559.md?page=3)
