Skip to content

ICU4X 2.0 Dart bindings questions #6677

@mosuem

Description

@mosuem

Date/Time formatting

  • There are 6 different formatters - are they all needed?
  final icu.DateTimeFormatter? _dateTimeFormatter;
  final icu.DateFormatter? _dateFormatter;
  final icu.TimeFormatter? _timeFormatter;
  late final icu.ZonedDateTimeFormatter? _zonedDateTimeFormatter;
  late final icu.ZonedDateFormatter? _zonedDateFormatter;
  final icu.ZonedTimeFormatter? _zonedTimeFormatter;
  • There are different constructors for zoned formatters, depending on the time zone format. But the timezone is parsed using icu.IanaParser() - why not just get the info from there?
        TimeZoneType.long => icu.ZonedDateTimeFormatter.specificLong,
        TimeZoneType.short => icu.ZonedDateTimeFormatter.specificShort,
        TimeZoneType.shortOffset =>
          icu.ZonedDateTimeFormatter.localizedOffsetShort,
        TimeZoneType.longOffset =>
          icu.ZonedDateTimeFormatter.localizedOffsetLong,
        TimeZoneType.shortGeneric => icu.ZonedDateTimeFormatter.genericShort,
        TimeZoneType.longGeneric => icu.ZonedDateTimeFormatter.genericLong,
  • The time formatter takes alignment and timePrecision arguments, how do they map to ECMA402 DateTimeFormat options?
  • What does TimeFormatStyle.full correspond to?
  icu.DateTimeLength timeTo4xOptions() => switch (this) {
    TimeFormatStyle.full => icu.DateTimeLength.long, //TODO: Does this match?
    TimeFormatStyle.long => icu.DateTimeLength.long,
    TimeFormatStyle.medium => icu.DateTimeLength.medium,
    TimeFormatStyle.short => icu.DateTimeLength.short,
  };
  • How do I set a Calendar to be used?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions