Ical.Net für den Export eingebaut.

Der Export enthält scheinbar jetzt keinerlei Zeitzonendaten
Import in Google, Outlook und auf der HP hat funktioniert
This commit is contained in:
Wombat 2025-01-05 20:02:47 +01:00
parent 508a3fb483
commit b16cf3d860
4 changed files with 38 additions and 2 deletions

View File

@ -102,14 +102,23 @@
<Reference Include="DevExpress.XtraSpreadsheet.v24.1, Version=24.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraTreeList.v24.1, Version=24.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraTreeMap.v24.1, Version=24.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="Ical.Net, Version=4.3.1.0, Culture=neutral, PublicKeyToken=65c0446cd019ea53, processorArchitecture=MSIL">
<HintPath>..\packages\Ical.Net.4.3.1\lib\netstandard2.0\Ical.Net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NodaTime, Version=3.2.0.0, Culture=neutral, PublicKeyToken=4226afe0d9b296d1, processorArchitecture=MSIL">
<HintPath>..\packages\NodaTime.3.2.0\lib\netstandard2.0\NodaTime.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />

View File

@ -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
'

View File

@ -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

View File

@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Ical.Net" version="4.3.1" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
<package id="NodaTime" version="3.2.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" />
</packages>