Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: library is open #154

Merged
merged 1 commit into from
Dec 18, 2018
Merged

API: library is open #154

merged 1 commit into from
Dec 18, 2018

Conversation

rerowep
Copy link
Contributor

@rerowep rerowep commented Dec 10, 2018

  • NEW: library is_open function

Signed-off-by: Peter Weber [email protected]

open the console and try to test the new date functions from library

@rerowep rerowep force-pushed the library-is-open-#739 branch 7 times, most recently from 50e2b7a to ca42e9e Compare December 13, 2018 07:21
Copy link

@BadrAly BadrAly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • most of the times: library.is_open() returns false when library is open
    must use the parameter "day_only=True" for this to work

@rerowep rerowep force-pushed the library-is-open-#739 branch 2 times, most recently from 5413b47 to 26318aa Compare December 17, 2018 13:54
start_date = parser.parse(exception_date['start_date'])
end_date = exception_date.get('end_date')
if end_date:
end_date = parser.parse(exception_date['end_date'])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parser.parse(end_date), no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, is better like this

times_open = not times_open
return times_open

def next_open(self, date=datetime.now(), previous=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure that default parameter calling function works... i.e. datetime.now().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested it. It is working.

* NEW: library is_open function

Signed-off-by: Peter Weber <[email protected]>
@rerowep rerowep force-pushed the library-is-open-#739 branch from 26318aa to 55b31c0 Compare December 18, 2018 08:52
@rerowep rerowep merged commit d398dc8 into rero:master Dec 18, 2018
@rerowep rerowep deleted the library-is-open-#739 branch December 18, 2018 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants