[IMP] Add a new function, last_day_of_current_month, this function returns the last day of the current month.

bzr revid: stephane@tinyerp.com-20090202140715-e5lw28lvrd9fep13
This commit is contained in:
Stephane Wirtel
2009-02-02 15:07:15 +01:00
parent 720ff8a9e5
commit 557cc93aae
+7
View File
@@ -40,6 +40,7 @@
#
import time
import calendar
import types
import string
import netsvc
@@ -62,6 +63,12 @@ from tools.config import config
regex_order = re.compile('^([a-zA-Z0-9_]+( desc)?( asc)?,?)+$', re.I)
def last_day_of_current_month():
import datetime
import calendar
today = datetime.date.today()
last_day = str(calendar.monthrange(today.year, today.month)[1])
return time.strftime('%Y-%m-' + last_day)
def intersect(la, lb):
return filter(lambda x: x in lb, la)