Force the settlement_date to always be a date
        :param value:
        :return:
772196
def settlement_date(self, value):
        
        if value:
            self._settlement_date = parse(value).date() if isinstance(value, type_check) else value
1019363
def enforce_timezone(self, value):
        
        field_timezone = getattr(self, 'timezone', self.default_timezone())

        if (field_timezone is not None) and not timezone.is_aware(value):
            return timezone.make_aware(value, field_timezone)
        elif (field_timezone is None) and timezone.is_aware(value):
            return timezone.make_naive(value, timezone.UTC())
        return value
399515
def __set_due_date(self, value):
        '''
        
        '''
        if type(value) != date:
            raise ValueError('Due date must be an instance of date.')

        if self.__date.date() and value < self.__date.date():
            raise ValueError("Due date cannot be anterior to the invoice " \
                             "date.")

        self.__due_date = value
354195
def setCurrentDate( self, date ):
        
        if ( date == self._currentDate or not date.isValid() ):
            return
        
        self._currentDate = date
        self.markForRebuild()
        
        parent = self.parent()
        if ( not parent.signalsBlocked() ):
            parent.currentDateChanged.emit(date)
            parent.titleChanged.emit(self.title())
534010
function (value) {
    var date = new Date(value)
    assertErr(!isNaN(date.getTime()), TypeError, 'Field error: value is an invalid Date')
    return date
  }
763055
def date_fromnow(self, value):
        
        import humanize
        language = self.get_language()
        if language != 'en':
            humanize.i18n.activate(language)
        return Markup(humanize.naturaltime(value))
987225
def is_date(property_name, *, format=None, present_optional=False, message=None):
    """"""
    # NOTE: Not currently using format param
    def check(val):
      """Checks that a value can be parsed as a date."""
      if val is None:
        return present_optional
      else:
        is_date, _ = util.try_parse_date(val)
        return is_date

    return Validation(check, property_name, message)
997473
def expiry_date(self, value):
        
        if value:
            self._expiry_date = parse(value).date() if isinstance(value, type_check) else value
268288
def value(self, new_value):
        
        datetime_value = None
        if new_value:
            datetime_value = new_value.strftime("%Y-%M-%dT%H:%M:%SZ")
        self._set_value(datetime_value)
237587
def certify_date(value, required=True):
    
    if certify_required(
        value=value,
        required=required,
    ):
        return

    if not isinstance(value, date):
        raise CertifierTypeError(
            message="expected timestamp (date∂), but value is of type {cls!r}".format(
                cls=value.__class__.__name__),
            value=value,
            required=required,
        )
976297
def set(self, instance, value, **kw):
        
        if value:
            try:
                value = DateTime(value)
            except SyntaxError:
                logger.warn("Value '{}' is not a valid DateTime string"
                            .format(value))
                return False

        self._set(instance, value, **kw)
531319
def date_from_number(self, value):
        
        if not isinstance(value, numbers.Real):
            return None
        delta = datetime.timedelta(days=value)
        return self._null_date + delta
1025176
def stringified_exchange_date
      value = (@exchange_date || Time.now.send(:to_date))
      [value.day, value.month, value.year].join('-')
    end
1094330
def value(self, new_value):
        
        self._value = (datetime.now(), new_value)
        self.history_add(self._value)
84625
def date(self, value=None):
        
        if not (value is None):
            if (self.metadatatype == "native"):
                self.metadata['date'] = value
            else:
                self._date = value
        if (self.metadatatype == "native"):
            if 'date' in self.metadata:
                return self.metadata['date']
            else:
                return None
        else:
            return self._date
1091636
def _normalize_dates(self, context):
        '''
        
        '''
        if 'start' in context:
            if isinstance(context['start'], dt.date):
                context['start'] = dt.date.strftime(
                    context['start'], format='%Y-%m-%d')
        if 'end' in context:
            if isinstance(context['end'], dt.date):
                context['end'] = dt.date.strftime(
                    context['end'], format='%Y-%m-%d')

        trading_dates = intuition.utils.build_trading_timeline(
            context.pop('start', None), context.pop('end', None))

        context['index'] = trading_dates
        context['live'] = (dt.datetime.now(tz=pytz.utc) < trading_dates[-1])
115071
def build_date(self):
        
        # pylint: disable=len-as-condition
        if len(self.dutinformation) > 0 and (self.dutinformation.get(0).build is not None):
            return self.dutinformation.get(0).build.date
        return None