Skip to content

[iOS/iPadOS] - locale property not fully applied on datetime picker translations #726

@coolersham

Description

@coolersham

Bug report

Summary

When using the RNDateTimePicker on iOS/iPadOS in datetime mode, while overwriting the locale with a supported local code and display with inline the Time label does not change its language.

issue

Reproducible sample code

import React from "react"

import { View } from "react-native"
import RNDateTimePicker from "@react-native-community/datetimepicker"

export default function App(): JSX.Element {
  return (
    <View
      style={{
        flex: 1,
        alignItems: "center",
        justifyContent: "center",
        backgroundColor: "white",
      }}
    >
      <RNDateTimePicker
        locale={"es"}
        display={"inline"}
        mode={"datetime"}
        value={new Date()}
        themeVariant={"light"}
      />
    </View>
  )
}

Steps to reproduce

  1. Create a new react-native app with the help of the CLI (template)
  2. Install this package and all other required dependencies via npm, yarn, etc.
  3. Install pods and build the iOS/iPadOS application on a device
  4. Paste the provided reproducible code into the correct file
  5. Save and try to perceive the issue

Describe what you expected to happen:

The label displayed for the time picker anchor (stating Time) should react to the configured locale property.

Environment info

react-native version: 0.71.3
datetimepicker version: 6.7.5
iOS / iPadOS version: 15.X and 16.X

... other version info is not relevant for this issue.

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