anthill / Python_OpeningHours

A wrapper of my C_OpeningHours in Python
MIT License
5 stars 1 forks source link

Conversion functions #2

Closed vallettea closed 8 years ago

vallettea commented 8 years ago

This module should enable anyone to convert to and from python datetime objects to openingHour strings.

Asphahyre commented 8 years ago

I didn't understand...

Do you mean converting from the OpeningHours Python object into the OpeningHours' standard string we can use to build the object?

The only function that's using a datetime object is the is_open method:

    def is_open(self, date):
        return self.is_open_expended(date.minute, date.hour, date.day, date.month - 1, date.year - 1900, date.weekday())