roggervalf / react-appointment-picker

React component to pick an appointment
MIT License
10 stars 13 forks source link

Change time and date format #19

Closed mustifanci closed 1 year ago

mustifanci commented 1 year ago

Hi. i have problem to change locale setting. `` useEffect(() => { if (date != null) { const initialDate = new Date( date.getFullYear(), date.getMonth(), date.getDate(), 15, 0, 0 );

  console.log("getting appointments");
  getAppointmentDays(date).then((days) => {
    setAppointment(
      <AppointmentPicker
        addAppointmentCallback={addAppointmentCallbackContinuousCase}
        removeAppointmentCallback={removeAppointmentCallbackContinuousCase}
        initialDay={initialDate}
        days={days}
        maxReservableAppointments={1}
        visible
        selectedByDefault
        unitTime={3600000}
        loading={loading}
        continuous
        locale={tr}

           />
    );
  });
}

}, [date, loading]);`


` return (
    <Container fluid>
      <Row>
        <Col xs={7} md={6}>
          <DayPicker
            locale={tr}
            weekStartsOn={1}
            mode="single"
            selected={date}
            onDayClick={(date) =>
              setDate(new Date(date.getTime() + 180 * 60 * 1000))
            } // utc saat ayarı çok uğraştık sonunda bulduk
            // modifiers={modifiers}
          />
        </Col>
        <Col xs={5} md={6}>
          {appointment}
        </Col>
        <button id="save-button">Publish</button>
      </Row>
    </Container>
  );`
data picker changed to local but appointmen picker doesn't change.
i want to change 24 h and yyyy-mm-dd date format. How can i do it? 
mustifanci commented 1 year ago

i fixed it i change locale={tr} to local={"tr-TR"}