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

Interested in time_expr #4

Open
omnisci3nce opened this issue Jul 1, 2022 · 3 comments
Open

Interested in time_expr #4

omnisci3nce opened this issue Jul 1, 2022 · 3 comments

Comments

@omnisci3nce
Copy link

In user_db.c you mention a time_expr field but have the check in a TODO block.

Would you be able to expand a bit more on what you intend to do with that and how that might work?

@polprog
Copy link
Owner

polprog commented Jul 1, 2022

This is for allowing access within some time period i elieve, after which the access token (card) is expired. @rpaciorek probably knows more.

@rpaciorek
Copy link
Contributor

It will be text-based flexible way to describe the access schedule. For example (wd >0 && wd <6 && dmin>=420 && dmin <960) || (wd == 6 && dmin>=540 && dmin <840) will allow access on workdays (Monday to Friday) from 7AM to 4PM and on Saturday from 9AM to 2 PM.

Most likely it will be implemented before October.

@omnisci3nce
Copy link
Author

omnisci3nce commented Jul 2, 2022

I thought so. I have some experience with this and I've used this library before https://github.com/jakubroztocil/rrule which conforms to the iCal specification. You can see an example of what a rule string becomes such as DTSTART:20120201T093000Z\nRRULE:FREQ=WEEKLY;INTERVAL=5;UNTIL=20130130T230000Z;BYDAY=MO,FR

I wonder if there is a C library out there for iCal RFC compatible rules?

It might save you a fair bit of work by using a known standard for scheduling expressions as well as save time using code that already exists.

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

No branches or pull requests

3 participants