def nearest_dom(year, month, day):
"""
Return day adjusted as necessary to fit within the days available in
year/month. For example:
nearest_dom(2017, 2, 30) #=> 28
"""
return min(calendar.monthrange(year, month)[1], day)
评论列表
文章目录