Skip to content

Commit

Permalink
Python formatting for markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
pschoenfelder committed Oct 29, 2015
1 parent 32cd208 commit c4ae712
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The goal of named dates is to provide a simple API to keep track of special date

### Usage
Need to recognize the 4th Thursday in November?
```
```python
register_named_date("Thanksgiving Day", 11, 3, nth=4,
aliases=["Thanksgiving", "Turkey Day"])
...
Expand All @@ -15,12 +15,12 @@ if is_named_date(my_date, "Thanksgiving"):
```

How about a date based on the end of the month? Say, the last Monday in May?
```
```python
register_named_date("Memorial Day", 5, 0, nth=1, from_end=True)
```

Something more complex? Define a custom function.
```
```python
def is_good_friday(date):
# Defaults to western Easter.
return date == easter(date.year) - datetime.timedelta(days=2)
Expand All @@ -29,7 +29,7 @@ register_named_date("Good Friday", custom_func=is_good_friday)
```

You can even group important dates into sets, find out which dates are in a set, and find out whether a date is in a set.
```
```python
make_named_date_set("MyFavoriteHolidays", ["Thanksgiving",
"Christmas",
"New Years"])
Expand Down

0 comments on commit c4ae712

Please sign in to comment.