Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date format is inconsistent (iOS only?) #881

Open
bpeltonc opened this issue Apr 5, 2024 · 6 comments
Open

Date format is inconsistent (iOS only?) #881

bpeltonc opened this issue Apr 5, 2024 · 6 comments

Comments

@bpeltonc
Copy link

bpeltonc commented Apr 5, 2024

Bug Report

Summary

At least on iOS, the date format as displayed on the button when the picker is not open is inconsistent.

Reproducible sample code

Simply clone this repository, install deps via yarn install && cd example && npx pod-install, then build and run the app on any iOS target.

Steps to reproduce

  1. Open the iOS Date Picker
  2. Select March 20, 2024
  3. The button shows "3/20/2024"

Describe what you expected to happen:

  1. Open the iOS Date Picker
  2. Select March 20, 2024
  3. The button shows "Mar 20, 2024"

Environment info

npx react-native info output:

System:
  OS: macOS 14.4.1
  CPU: (10) arm64 Apple M1 Max
  Memory: 98.97 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.9.0
    path: ~/.nvm/versions/node/v20.9.0/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 8.19.4
    path: ~/datetimepicker/node_modules/.bin/npm
  Watchman:
    version: 2024.01.22.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.2
    path: /Users/brandon/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK:
    API Levels:
      - "27"
      - "30"
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 28.0.2
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-30 | Google APIs ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-UpsideDownCakePrivacySandbox | Google Play ARM 64 v8a
      - android-VanillaIceCream | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10227.8.2321.11479570
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.4.1
    path: /Users/brandon/.jenv/shims/javac
  Ruby:
    version: 3.2.1
    path: /Users/brandon/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.7
    wanted: ^0.72.7
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: false
  newArchEnabled: true
iOS:
  hermesEnabled: false
  newArchEnabled: false

datetimepicker version: 7.6.4

iOS / Android version: 17.4

@nlarif
Copy link

nlarif commented Jun 30, 2024

same issue here

@wheelie33
Copy link

Same issue as well. I select August 1, 2024 and the display renders "Aug 1, 2024". Select August 8, 2024 and the display renders "8/8/24".

I'll play with the width of the control to see if it's just a space saving feature that's undocumented.

@eumaninho54
Copy link

eumaninho54 commented Jul 1, 2024

@wheelie33 that's right, a space saving

A quick fix for now

<DateTimePicker 
    style={{ paddingHorizontal: 30, left: -30 }}
    ...other props
/>

@moak
Copy link

moak commented Jul 5, 2024

Same problem here, also the dateFormat seems buggy on iphone too. Would be nice to be able to customize like dddd day string week format like Fri. Thu. etc

@Zagorodnyi
Copy link

This is still an issue. Bump

@takonguina
Copy link

Same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants