Reset the date to the last day of the week
        and the time to 23:59:59.

        :rtype: DateTime
434838
def _end_of_week(self):
        
        dt = self

        if self.day_of_week != pendulum._WEEK_ENDS_AT:
            dt = self.next(pendulum._WEEK_ENDS_AT)

        return dt.end_of("day")
1013365
def datetime(self):
        ''
        index = self.data.index.remove_unused_levels()
        return pd.to_datetime(index.levels[0])
920987
def date(self):
        
        if self._date:
            return self._date
        return datetime.datetime.now().strftime('%Y-%m-%d')
124432
def get_period_last_week() -> str:
    
    today = Datum()
    today.start_of_day()
    # start_date = today - timedelta(days=7)
    start_date = today.clone()
    start_date.subtract_days(7)

    period = get_period(start_date.value, today.value)
    return period
711113
def __set_date(self, value):
        '''
        
        '''
        value = date_to_datetime(value)
        if value > datetime.now() + timedelta(hours=14, minutes=1): #More or less 14 hours from now in case the submitted date was local
            raise ValueError("Date cannot be in the future.")

        if self.__due_date and value.date() > self.__due_date:
            raise ValueError("Date cannot be posterior to the due date.")

        self.__date = value
31712
def today(self) -> datetime:
        
        self.value = datetime.combine(datetime.today().date(), time.min)
        return self.value
796599
def clear_start_date(self):
        
        if (self.get_start_date_metadata().is_read_only() or
                self.get_start_date_metadata().is_required()):
            raise errors.NoAccess()
        self._my_map['startDate'] = self._mdata['start_date']['default_date_time_values'][0]
116730
function week(date) {
  var d = new Date(+date);
  var y, w;

  d.setHours(0, 0, 0);
  d.setDate(d.getDate() + 4 - (d.getDay()||7));

  y = new Date(d.getFullYear(), 0, 1);
  w = Math.ceil((((d - y) / DAY_M) + 1) / 7);
  return d.getFullYear() + '-W' + zeroFill(w);
}
1190845
def picknthweekday(year, month, dayofweek, hour, minute, whichweek):
    """"""
    first = datetime.datetime(year, month, 1, hour, minute)
    weekdayone = first.replace(day=((dayofweek-first.isoweekday())%7+1))
    for n in range(whichweek):
        dt = weekdayone+(whichweek-n)*ONEWEEK
        if dt.month == month:
            return dt
1017171
def auto_invalidate(self):
        
        current = datetime.now()
        if current > self._invalidated + timedelta(seconds=self._timetolive):
            self.invalidate()
958171
def last_login_date(self):
        
        return sa.Column(
            sa.TIMESTAMP(timezone=False),
            default=lambda x: datetime.utcnow(),
            server_default=sa.func.now(),
        )
872674
def working_tomorrow(self, date_from=None, date_format=None):
		
		# date de demain que sur les jours de week-end
		return self.delta(days=1, date_from=date_from, date_format=date_format, days_range=[1, 2, 3, 4, 5, 6])
896284
def weekend_yesterday(self, date_from=None, date_format=None):
		
		# date d'hier que sur les jours de week-end
		return self.delta(days=-1, date_from=date_from, date_format=date_format, days_range=[6, 7])
175563
def start_of_day(val):
    
    if type(val) == date:
        val = datetime.fromordinal(val.toordinal())
    return val.replace(hour=0, minute=0, second=0, microsecond=0)
61780
def get_last_weekday(self, including_today=False):
        
        weekday = self.date_time.weekday()
        return Weekday.get_last(weekday, including_today=including_today)
625637
def all_day=(time)
      if time.class == String
        time = Time.parse(time)
      end
      @start_time = time.strftime("%Y-%m-%d")
      @end_time = (time + 24*60*60).strftime("%Y-%m-%d")
    end
1241123
def start_datetime(self) -> Optional[datetime.datetime]:
        
        if not self.intervals:
            return None
        return self.intervals[0].start