Facebook
From Harrison, 4 Months ago, written in Python.
Embed
Download Paste or View Raw
Hits: 62
  1. @api.depends('date')
  2.     def _compute_day(self):
  3.         weeks_names = ["Lunes", "Martes", "Mi√©rcoles", "Jueves", "Viernes", "S√°bado", "Domingo"]
  4.         for waypoint in self:
  5.             new_format_day = datetime.datetime.strptime(waypoint.date, '%Y-%m-%d %H:%M:%S')
  6.             waypoint.day = weeks_names[int(new_format_day.strftime('%w'))-1]