diff --git a/FWCreateCalendar/FWCreateCalendar.vbproj b/FWCreateCalendar/FWCreateCalendar.vbproj index c88dd17..aa37e14 100644 --- a/FWCreateCalendar/FWCreateCalendar.vbproj +++ b/FWCreateCalendar/FWCreateCalendar.vbproj @@ -102,14 +102,23 @@ + + ..\packages\Ical.Net.4.3.1\lib\netstandard2.0\Ical.Net.dll + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + + ..\packages\NodaTime.3.2.0\lib\netstandard2.0\NodaTime.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + diff --git a/FWCreateCalendar/frmMain.Designer.vb b/FWCreateCalendar/frmMain.Designer.vb index 6404709..c2928bc 100644 --- a/FWCreateCalendar/frmMain.Designer.vb +++ b/FWCreateCalendar/frmMain.Designer.vb @@ -364,7 +364,7 @@ Partial Class frmMain Me.schedStorage.Appointments.Labels.CreateNewLabel(8, "Birthday", "&Birthday", System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(207, Byte), Integer), CType(CType(233, Byte), Integer))) Me.schedStorage.Appointments.Labels.CreateNewLabel(9, "Anniversary", "&Anniversary", System.Drawing.Color.FromArgb(CType(CType(141, Byte), Integer), CType(CType(233, Byte), Integer), CType(CType(223, Byte), Integer))) Me.schedStorage.Appointments.Labels.CreateNewLabel(10, "Phone Call", "Phone &Call", System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(247, Byte), Integer), CType(CType(165, Byte), Integer))) - Me.schedStorage.TimeZoneId = "UTC" + Me.schedStorage.TimeZoneId = "E. Europe Standard Time" ' 'SFD ' diff --git a/FWCreateCalendar/frmMain.vb b/FWCreateCalendar/frmMain.vb index 2005d99..5df7417 100644 --- a/FWCreateCalendar/frmMain.vb +++ b/FWCreateCalendar/frmMain.vb @@ -9,6 +9,8 @@ Imports DevExpress.XtraGrid.Views.Base Imports DevExpress.XtraGrid.Views.Grid Imports DevExpress.XtraScheduler Imports DevExpress.XtraScheduler.iCalendar +Imports Ical.Net.DataTypes +Imports Ical.Net.Serialization Imports Microsoft.Office.Interop Public Class frmMain @@ -260,7 +262,8 @@ Public Class frmMain AddHandler exporter.AppointmentExporting, AddressOf Exporter_AppointmentExporting Dim failed As Boolean Try - exporter.Export(SFD.FileName) + 'exporter.Export(SFD.FileName) + IcalNetTest(SFD.FileName) Catch ex As Exception failed = True End Try @@ -268,6 +271,27 @@ Public Class frmMain End If End Sub + Private Sub IcalNetTest(OutputFile As String) + Dim calendar As New Ical.Net.Calendar + 'calendar.AddTimeZone(New Ical.Net.CalendarComponents.VTimeZone("Europe/Berlin")) + 'calendar.AddTimeZone(New Ical.Net.CalendarComponents.VTimeZone(General.Settings.DefaultTimezoneId)) + For Each evt As EventEntry In ds.Where(Function(e) e.IsInvalid = False AndAlso e.Exclude = False) + calendar.Events.Add(New Ical.Net.CalendarComponents.CalendarEvent With { + .Start = New CalDateTime(evt.StartDate), + .[End] = New CalDateTime(evt.EndDate), + .IsAllDay = evt.AllDay, + .Location = evt.Location, + .Summary = evt.Subject '.Categories = {evt.Category} Kategorien machen beim Import in Joomla JEvents probleme + }) + Next + + Dim serializer As New CalendarSerializer + Using sw As New StreamWriter(OutputFile, False, System.Text.Encoding.UTF8) + sw.Write(serializer.SerializeToString(calendar)) + End Using + + End Sub + Private Sub Exporter_AppointmentExporting(sender As Object, e As AppointmentExportingEventArgs) 'e.Appointment.TimeZoneId = sched.OptionsBehavior.ClientTimeZoneId 'e.Appointment.TimeZoneId = General.Settings.DefaultTimezoneId diff --git a/FWCreateCalendar/packages.config b/FWCreateCalendar/packages.config index bc2a97e..876c411 100644 --- a/FWCreateCalendar/packages.config +++ b/FWCreateCalendar/packages.config @@ -1,4 +1,7 @@  + + + \ No newline at end of file