Skip to content

Difference between Partial objects for with and from_partial #349

Open
@nekevss

Description

@nekevss

When doing some updates on Boa recently, I noticed that there's an important difference between the property bag that is provided to from and with. Namely, with ALWAYS uses the calendar of self where partial. We should update the Partials to account for this difference.

The question is how should this be represented?

My current thoughts is to create a new CalendarFields struct and then PartialDate is updated to:

struct PartialDate {
    calendar_fields: CalendarFields,
    calendar: Calendar,
} 

struct DateTimeFields {
    calendar_fields: CalendarFields,
    time: PartialTime,
}

struct PartialDateTime {
    fields: DateTimeFields,
    calendar: Calendar
}

struct ZonedDateTimeFields {
    calendar_fields: CalendarFields,
    time: PartialTime,
    offset: Offset,
    time_zone: TimeZone,
}

struct PartialZonedDateTime {
    fields: ZonedDateTimeFields,
    calendar: Calendar
}

This would mean that with methods are then updated to accept a XFields struct while from_partial accepts the PartialX.

Of course, this approach ultimately might cause more issues for how ZonedDateTime's from_partial and with_with_provider methods should handle the updates. I've attempted to roughly sketch out the impact of the fields above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions