ionic-team / capacitor-plugins

Official plugins for Capacitor ⚡️
518 stars 583 forks source link

feat: `weekday` support in LocalNotifications #129

Closed littke closed 2 years ago

littke commented 4 years ago

Feature Request

Describe the Feature Request

I'd like to schedule recurring local notifications on Tuesdays and Thursdays at a given hour.

Platform Support Requested

Describe Preferred Solution

I'd like to schedule it using the on keyword together with a (new) weekday (0-6) keyword.

Describe Alternatives

I don't see a way around this, as day is only 0-30. I could use every — but that doesn't let me set the hour of delivery. https://github.com/ionic-team/capacitor/issues/2752 goes into further detail.

Related Code

schedule: {
  on: {
    hour: 20,
    weekday: 2
  }
},
...
schedule: {
  on: {
    hour: 20,
    weekday: 4
  }
},

Additional Context

MarekGogol commented 3 years ago

Would be really great to have this feature! Thanks.

dahyui commented 3 years ago

@littke Just wondering if you managed to work around this? If so, what did you do?

I managed to fix it for iOS and get it working by adding weekday in the DateComponent. I'm having trouble getting Java (Android) working as I'm not familiar with Java either.

littke commented 3 years ago

@dahyui I never got it to work! I gave up. Sorry!

kim-jos commented 3 years ago

I was able to add weekday functionality for the on keyword for Android . I created a pull request, but if you need it before it merges you should check out the following link and copy and paste the pertinent files. #601

ionitron-bot[bot] commented 2 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.