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

When putting in admin days available to work, calander to book is off by a row. #172

Open
1 of 4 tasks
nadermx opened this issue Apr 2, 2024 · 14 comments
Open
1 of 4 tasks

Comments

@nadermx
Copy link

nadermx commented Apr 2, 2024

Describe the bug
Even in the example page, it shows Sunday-Thursday days avaiable to work.

To Reproduce
Make monday day avaiable to work, shows only tuesday as day avaiable, and says no one avaible to work on tuesday.

Expected behavior
Should show monday

Can you fix the bug?

  • Yes, I can fix the bug and will open a pull request.
  • No, I can't fix the bug, but I can assist in testing and providing feedback.
  • No, I can't fix the bug, but I can provide more information to help you fix it.
  • No, I can't fix the bug, but I can open an issue to report it.
@adamspd
Copy link
Owner

adamspd commented Apr 2, 2024

Hi @nadermx, can you provide screenshot ? I tried to reproduce the bug describe, but was unable to do so.

@nadermx
Copy link
Author

nadermx commented Apr 2, 2024

Sure, I have a few.
When I make a new staff memeber their username does not appear in the admin
image
The staff memeber doesn't appear in the drop down when adding in working hours either,
image
But as seen here, I make the working hours, Monday from 6am to 6pm, and it shows it closed still
image
And in your home page example it also shows days available as Sunday through thursday, altough I'm sure you have it set as monday-friday?
image

@nadermx
Copy link
Author

nadermx commented Apr 2, 2024

Okay, just saw that the staff memeber didn't have in the user profile a first and last name, that fixes the name issue, but the day issue on the map is still off.

@nadermx
Copy link
Author

nadermx commented Apr 2, 2024

I was checking the views.py in the appointment folder, and I think it has to do with either not saving the working days timezone specific, or not calling the days timzone specific. Been messing with it to no avail thus far

@nadermx
Copy link
Author

nadermx commented Apr 2, 2024

Did a pull request with the fix #174

@adamspd
Copy link
Owner

adamspd commented Apr 5, 2024

Hi @nadermx, I will have a look. Thanks

@adamspd
Copy link
Owner

adamspd commented Apr 5, 2024

And in your home page example it also shows days available as Sunday through thursday, altough I'm sure you have it set as monday-friday?

The homepage is a screenshot from a project that I use the package in, and no, it's not set from monday - friday but from sunday to thursday. I can't seem to find out why it behaves differently when you're running it...But I'll investigate from your pull request.

@adamspd
Copy link
Owner

adamspd commented Apr 5, 2024

Okay, just saw that the staff memeber didn't have in the user profile a first and last name, that fixes the name issue, but the day issue on the map is still off.

As mentioned by @deronnax, I need to use the username a little bit more than just first and last name. I will fix that in a coming release.

@nadermx
Copy link
Author

nadermx commented Apr 5, 2024 via email

@adamspd
Copy link
Owner

adamspd commented Apr 5, 2024

Interesting. On a fresh install when I tried to make as shown on screenshots, it allowed it Tuesday. I ha e Django timezone set to America/Mexico_city

Noted. It shouldn't be that way indeed.

@adamspd
Copy link
Owner

adamspd commented May 18, 2024

Hi @nadermx,

Sorry for the late response to your issue. I've been busy with work and other things. Would you be willing to show me your settings file and a screenshot of the error where the timezone is not updating, resulting in the incorrect day?

@adamspd
Copy link
Owner

adamspd commented May 18, 2024

When I make a new staff memeber their username does not appear in the admin

I fixed that in the latest release

Did a pull request with the fix #174

Unfortunately, you didn't run the test files.

@adamspd
Copy link
Owner

adamspd commented May 25, 2024

Hi @nadermx, I've reviewed and tested your changes. Unfortunately, it introduces a mismatch between Python and JavaScript's handling of weekday indices, leading to potential bugs in date-related functionalities.

Specifically, while JavaScript treats Sunday as 0, Python treats Monday as 0 as you did in your PR. The thing is, one way or another, you have to align both languages somehow, either you use Python's way, or Javascript's way. I chose Javascript's way because it was easier to maintain, thus I added the functions to send the data to the frontend in Javascript's way.

Accepting your PR (#174) will add a discrepancy that will particularly affect scripts that depend on synchronized day indices between the client and server sides, leading to calculation errors and display issues.

Maintaining alignment with JavaScript conventions in the backend ensures that both sides interpret weekday indices consistently, avoiding these issues.

Now, maybe your specific problem is due to something else, if you're still interested, perhaps we can have a look at it together.

@nadermx
Copy link
Author

nadermx commented May 25, 2024 via email

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

2 participants