Skip to content

Date format does not use UTC #440

Closed
Closed
@DerBasler

Description

@DerBasler

Current behaviour

// end date used as input
const date = new Date('2025-01-23T23:59:59.999Z');
console.log(new Intl.DateTimeFormat('de').format(date));
// shows "24.1.2025" so +1 then what it should

Expected behaviour

It should use utc and show the selected date in this case "23.1.2025"

How to reproduce?

  const myStart = new Date();
  myStart.setDate(22)
  // + 1 day and end of day
  const myEnd = new Date();
  myEnd.setDate(23)
  myEnd.setHours(23, 59, 59, 999); 

return (
<DatePickerModal
startDate={myStart}
endDate={myEnd}
visible={true}
locale='de'
mode="range"
onConfirm={()=>{}}
onDismiss={()=>{}}
/>);

Preview

image

What have you tried so far?

#441 (UTC is already used in \src\Time\TimePicker.tsx)

Your Environment

software version
ios x
android x
react-native x.x.x
react-native-paper x.x.x
node x.x.x
npm or yarn x.x.x
expo sdk x.x.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions