[IMP] improved code

bzr revid: dizzy.zala@gmail.com-20140321120550-8p0l6lh5iv45mvf7
This commit is contained in:
Dharmraj Jhala (OpenERP) 2014-03-21 17:35:50 +05:30
parent e925756b7f
commit c96f080e72
1 changed files with 3 additions and 3 deletions

View File

@ -211,9 +211,9 @@ class website_event(http.Controller):
return {'country_code': GI.country_code_by_addr(request.httprequest.remote_addr), 'country_name': GI.country_name_by_addr(request.httprequest.remote_addr)}
def get_formated_date(self, event):
start_date = datetime.strptime(event.date_begin, "%Y-%m-%d %H:%M:%S").date()
end_date = datetime.strptime(event.date_end, "%Y-%m-%d %H:%M:%S").date()
return start_date.strftime("%b")+" "+start_date.strftime("%e")+ (end_date != start_date and ("-"+end_date.strftime("%e")) or "")
start_date = datetime.strptime(event.date_begin, tools.DEFAULT_SERVER_DATETIME_FORMAT).date()
end_date = datetime.strptime(event.date_end, tools.DEFAULT_SERVER_DATETIME_FORMAT).date()
return ('%s %s%s') % (start_date.strftime("%b"), start_date.strftime("%e"), (end_date != start_date and ("-"+end_date.strftime("%e")) or ""))
@http.route('/event/get_country_event_list', type='http', auth='public', website=True)
def get_country_events(self ,**post):