This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
import calendar | |
def genDatePeriods(startDate, endDate, format='%Y-%m-%d'): | |
dt1 = datetime.strptime(startDate, format) | |
dt2 = datetime.strptime(endDate, format) | |
for year in range(dt1.year, dt2.year + 1): | |
for month in range(1, 13): | |
day0 = dt1.day if month == dt1.month and year == dt1.year else 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def genDateWeeks(startDate, endDate): | |
dt1 = datetime.datetime.strptime(startDate, "%Y-%m-%d") | |
dt2 = datetime.datetime.strptime(endDate, "%Y-%m-%d") | |
# first day of startDate's week | |
dt1 = dt1 - datetime.timedelta(days = dt1.weekday()) | |
totalWeeks = int(math.ceil(((dt2 + datetime.timedelta(1))-dt1).total_seconds()/60/60/24/7)) | |
return [ | |
[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def genDateRange(startDate, endDate): | |
dt0 = datetime.datetime.strptime(startDate, "%Y-%m-%d") | |
dt1 = datetime.datetime.strptime(endDate, "%Y-%m-%d") | |
for n in range(int ((dt1 - dt0).days) + 1): | |
yield (dt0 + datetime.timedelta(n)).strftime("%Y-%m-%d") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Kitteh! | |
*/ | |
.img { | |
margin: 0px auto; | |
width: 185px; | |
height: 185px; | |
position: relative; | |
border-radius: 5px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Playing with CSS | |
*/ | |
* { margin: 0; } | |
body { | |
background-color: slategray; | |
font: 12pt "Cochin", Georgia, serif; | |
line-height: 1.5em; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Playing with CSS | |
*/ | |
* { margin: 0; } | |
body { | |
background-color: slategray; | |
font: 12pt "Cochin", Georgia, serif; | |
line-height: 1.5em; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Learning stuff | |
*/ | |
body { | |
background-color: #555; | |
} | |
.button { | |
border: 1px solid rgba(0,0,0,.4); | |
background-color: #444; | |
color: #fff; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Learning stuff | |
*/ | |
body { | |
background-color: #555; | |
} | |
.button { | |
border: 1px solid rgba(0,0,0,.4); | |
background-color: #444; | |
color: #fff; |