Please solve the programming task below using a self-contained code snippet in a markdown code block.

Given a string date representing a Gregorian calendar date formatted as YYYY-MM-DD, return the day number of the year.
 
Please complete the following python code precisely:
```python
class Solution:
    def dayOfYear(self, date: str) -> int:
```