Skip to content

Initializing a CalDateTime instance with midnight time is treated as date-only #633

@axunonb

Description

@axunonb

Value = new DateTime(value.Year, value.Month, value.Day, value.Hour, value.Minute, value.Second, value.Kind);
HasDate = true;
HasTime = value.Second != 0 || value.Minute != 0 || value.Hour != 0;

The time specification for midnight should not be considered as date-only when initializing a CalDateTime instance.
Also, when the underlying DateTime Value is set to a new value without updating CalDateTime,HasTime this becomes an ambiguity, users may not be aware of.
Both can lead to unexpected behavior, e.g. in terms of (but not limited to) recurrences.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions