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

Cannot fetch birthdays next week #30

Closed
Timmy93 opened this issue Aug 9, 2019 · 1 comment
Closed

Cannot fetch birthdays next week #30

Timmy93 opened this issue Aug 9, 2019 · 1 comment
Labels
invalid This doesn't seem right

Comments

@Timmy93
Copy link

Timmy93 commented Aug 9, 2019

I wasn't able to download the birthdays of the next week because them are written like "monday" and not like "day/month".

The workaround was to replace the 'weekday name' with 'day/month'.
My FB locale is italian so I replaced sabato (Saturday) with 10/8, domenica (Sunday) with 11/8 and so on.

I added the following dates at line 608, before parsed_date = datetime.strptime(birthday_date_str, locale_date_format_mapping[user_locale])

Here is the code, simple but working:

        if birthday_date_str == 'sabato':
            birthday_date_str = '10/8'
        if birthday_date_str == 'domenica':
            birthday_date_str = '11/8'
        if birthday_date_str == 'lunedì':
            birthday_date_str = '12/8'
        if birthday_date_str == 'martedì':
            birthday_date_str = '13/8'
        if birthday_date_str == 'mercoledì':
            birthday_date_str = '14/8'
        if birthday_date_str == 'giovedì':
            birthday_date_str = '15/8'
        if birthday_date_str == 'venerdì':
            birthday_date_str = '16/8'```
@mobeigi mobeigi added the invalid This doesn't seem right label Aug 10, 2019
@mobeigi
Copy link
Owner

mobeigi commented Aug 10, 2019

Hey, this feature is actually already supported. There is no need to hardcode the day names but its good that it worked for you. Keep in mind hard coding the dates will not work as they will change if you run it in the future.

The problem you may have faced is system locale issues mentioned here:
#27

@mobeigi mobeigi closed this as completed Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants