Skip to content

Wrong example of format patterns in api documentation #45

@ZainUrRehmanKhan

Description

@ZainUrRehmanKhan

Format Pattern Example from api documentation in intl/date_format.dart

205  /// Examples Using the US Locale:
206  ///
207  ///     Format Pattern                    Result
208  ///     --------------                    -------
209  ///     'EEE, MMM d, ''yy'                Wed, Jul 10, '96
210  ///     'h:mm a'                          12:08 PM
211  ///     'yyyyy.MMMMM.dd GGG hh:mm aaa'    01996.July.10 AD 12:08 PM

documentation continued...

Steps to reproduce:

  1. use intl: ^0.16.1 in your pubspec.yaml file
  2. Place the below Text Widgets anywhere
  3. Text('TODAY, ' + DateFormat('EEE, MMM d, ''yy').format(DateTime.now()) ) using first format here
    Excepted Result: Wed, Jul 10, '96
    Actual Result: Wed, Jul 10, 96
  4. Text('TODAY, ' + DateFormat('yyyyy.MMMMM.dd GGG hh:mm aaa').format(DateTime.now()) ) using third format here
    Excepted Result: 01996.July.10 AD 12:08 PM
    Actual Result: 01996.J.10 AD 12:08 PM

flutter doctor v
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 1.25.0-8.3.pre, on Microsoft Windows [Version 10.0.19042.572], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Android Studio (version 4.1.0)
[√] IntelliJ IDEA Ultimate Edition (version 2020.3)
[√] Connected device (1 available)

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestpackage:intltype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)type-documentationA request to add or improve documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions