from datetime import datetime
@api.onchange('demo_time_start', 'demo_time_end', 'demo_day')def calculate_date(self): if self.demo_time_start and self.demo_time_end: d1 = datetime.strptime(str(self.demo_time_start), '%Y-%m-%d') d2 = datetime.strptime(str(self.demo_time_end), '%Y-%m-%d') d3 = d2 - d1 self.demo_day = str(d3.days)
No comments:
Post a Comment