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

Concise not working if two sets #22

Open
oesah opened this issue Mar 5, 2017 · 1 comment
Open

Concise not working if two sets #22

oesah opened this issue Mar 5, 2017 · 1 comment
Assignees
Labels

Comments

@oesah
Copy link

oesah commented Mar 5, 2017

Hey,

the concise display of the openinghours do not work, if the company has a break. It will display all of the weekdays. I managed to find the potential source:

openinghours/templatetags/openinghours_tags.py
lines 141 - 150

    for day in days:
        if 'hours' not in current_set.keys():
            current_set = {'day_names': [day['name']],
                           'hours': day['hours']}
        elif day['hours'] != current_set['hours']: # note 1
            concise_days.append(current_set)
            current_set = {'day_names': [day['name']],
                           'hours': day['hours']}
        else:
            current_set['day_names'].append(day['name'])

Note 1: Here, if you have two sets, it will change current_set. Thus, day['hours'] != current_set['hours'] will always be true for those cases. It should check, if there is a day['hours'] in concise_days and do actions according to it existence.

Do you guys have a solution for this? I am struggling with it.

@jvamvas jvamvas self-assigned this Mar 7, 2017
@jvamvas jvamvas added the bug label Mar 7, 2017
@jvamvas
Copy link
Contributor

jvamvas commented Mar 7, 2017

Thanks for the report, @oesah! We will look into this

@jvamvas jvamvas assigned philippeowagner and unassigned jvamvas Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants