ja2375 / add_2_calendar

A really simple Flutter plugin to add events to each platform's default calendar..
MIT License
188 stars 111 forks source link

support weekdays for iOS and Android #125

Open justincbeck opened 1 year ago

justincbeck commented 1 year ago

This PR adds the ability to handle a more custom schedule. Basically, it handles days of the week in the circumstance where the recurrence is weekly with a custom set of days.

I've tested this on device for Android and iOS and it works well. Of course, if there are changes needed, let me know. :)

diegogarciar commented 11 months ago

@justincbeck sorry for the late response, but could you update your branch?

justincbeck commented 11 months ago

@justincbeck sorry for the late response, but could you update your branch?

Yeah, no problem. Probs get to it later today or early next week.

MichalDanielDobrzanski commented 9 months ago

Hey guys, any updates here about merging this and releasing the new plugin update?

justincbeck commented 9 months ago

@diegogarciar - I have resolved the conflicts but have not had time to test again. Thanks and sorry for the delay.

justincbeck commented 8 months ago

Hey guys, any updates here about merging this and releasing the new plugin update?

You could use my fork if you're still needing this. ¯_(ツ)_/¯

diegogarciar commented 8 months ago

Just tested on iOS and its working great, but it doesn't seem to be working on android

this is the code used

ListTile(
              title: const Text('Add event with recurrence 1'),
              subtitle: const Text("weekly for 3 months"),
              trailing: const Icon(Icons.calendar_today),
              onTap: () {
                Add2Calendar.addEvent2Cal(buildEvent(
                  recurrence: Recurrence(
                    frequency: Frequency.weekly,
                    days: ['monday', 'wednesday', 'friday'],
                    endDate: DateTime.now().add(const Duration(days: 60)),
                  ),
                ));
              },
            ),

also, could you make the days an enum? days: ['monday', 'wednesday', 'friday'], we could use a custom enum or use days: [DateTime.monday, DateTime.wednesday], and then translate the ints into strings on a switch

justincbeck commented 8 months ago

Yup, I can take a look.