1 2 3 4 5 6 7 8 9 10 | def suma_dias_habiles(fecha_origen, dias):
h = dias
ds = 5 - fecha_origen.weekday() # distancia al sabado
s = 0
if h >= ds:
s = s + 2
h = h - ds
s = s + h / 5 * 2
return datetime.date.fromordinal( fecha_origen.toordinal() + dias + s )
|
More like this
- SelectDateWidget with format: day, month, year by zenx 2 years, 1 month ago
- DateTimeFluxCapacitor by jbcurtin 1 year ago
- Timedelta template tag by dballanc 4 years, 9 months ago
- Past days template filter by ramen 2 years, 2 months ago
- Naked CSS Day TemplateTag by webology 2 years, 10 months ago
Comments