def set_no_editable(self): if self.calendarClock is not None: self.data_value = self.calendarClock.time self.calendarClock.setVisible(False) if self.data_value is not None: self.dateTimeLabel.setText( datetime_to_str(self.data_value, self.dateFormat))
def set_no_editable(self): if self.calendar is not None: self.data_value = self.calendar.selectedDate().toPyDate() self.calendar.setVisible(False) if self.data_value is not None: self.dateLabel.setText( datetime_to_str(self.data_value, self.dateFormat))
def update_label(self): if isinstance(self.data_value, datetime.datetime): self.timeDeltaLabel.setText( datetime_to_str(self.data_value, self.dateFormat)) if isinstance(self.data_value, int): text = '' for index, result in enumerate( get_detail_time_delta(self.data_value)): if result[0] != 0: text += '{}{}'.format(result[0], result[1]) self.timeDeltaLabel.setText(text)
def set_value(self, value): if value is not None: self.data_value = value self.dateTimeLabel.setText(datetime_to_str(value, self.dateFormat))