diff --git a/GUT.Schedule/GUTSchedule.Droid/Resources/values/strings.xml b/GUT.Schedule/GUTSchedule.Droid/Resources/values/strings.xml
index 2ac0657..559620c 100644
--- a/GUT.Schedule/GUTSchedule.Droid/Resources/values/strings.xml
+++ b/GUT.Schedule/GUTSchedule.Droid/Resources/values/strings.xml
@@ -37,7 +37,7 @@
For semester
Set reminders for
- (i) Attention, for cloud-based Google calendars Google automatically sets reminders for 30 minutes if there\'s no reminder set by user
+ (i) Attention, if you choose \"None\" for cloud-based Google calendars Google sets default reminder for events automatically sets reminders for 30 minutes if there\'s no reminder set by user
None
At the start of event
5 minutes
diff --git a/GUT.Schedule/GUTSchedule.UWP/Calendar.cs b/GUT.Schedule/GUTSchedule.UWP/Calendar.cs
index 2f0192a..b10e01d 100644
--- a/GUT.Schedule/GUTSchedule.UWP/Calendar.cs
+++ b/GUT.Schedule/GUTSchedule.UWP/Calendar.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using Windows.ApplicationModel.Appointments;
+using Windows.ApplicationModel.Resources;
namespace GUTSchedule.UWP
{
@@ -11,21 +12,24 @@ namespace GUTSchedule.UWP
{
public static async Task> GetCalendars()
{
- AppointmentStore calendarStore = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AllCalendarsReadWrite);
+ AppointmentStore calendarStore = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AppCalendarsReadWrite);
return await calendarStore.FindAppointmentCalendarsAsync();
}
- public static async Task Export(List schedule, bool addGroupToTitle, int reminder, string calendar)
+ public static async Task Export(List schedule, bool addGroupToTitle, int reminder)
{
AppointmentStore calendarStore = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AllCalendarsReadWrite);
- AppointmentCalendar cal = await calendarStore.GetAppointmentCalendarAsync(calendar);
+ string calendarName = schedule.Any(i => string.IsNullOrWhiteSpace(i.Group)) ? ResourceLoader.GetForCurrentView().GetString("mySchedule") : schedule.FirstOrDefault().Group;
+ AppointmentCalendar cal =
+ (await calendarStore.FindAppointmentCalendarsAsync()).FirstOrDefault(i => i.DisplayName == calendarName) ??
+ await calendarStore.CreateAppointmentCalendarAsync(calendarName);
foreach (Occupation item in schedule)
{
Appointment appointment = new Appointment
{
BusyStatus = AppointmentBusyStatus.Busy,
- Details = item.Opponent + "\xFEFF",
+ Details = item.Opponent,
DetailsKind = AppointmentDetailsKind.PlainText,
Location = item.Cabinet,
Reminder = reminder < 0 ? (TimeSpan?)null : TimeSpan.FromMinutes(reminder),
@@ -42,18 +46,14 @@ namespace GUTSchedule.UWP
}
}
- public static async Task Clear(bool keepPrevious = true)
+ public static async Task Clear(IEnumerable