-
Notifications
You must be signed in to change notification settings - Fork 25
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
API: library is open #154
Conversation
50e2b7a
to
ca42e9e
Compare
There was a problem hiding this 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
5413b47
to
26318aa
Compare
rero_ils/modules/libraries/api.py
Outdated
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']) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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()
.
There was a problem hiding this comment.
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]>
26318aa
to
55b31c0
Compare
Signed-off-by: Peter Weber [email protected]
open the console and try to test the new date functions from library