wix / react-native-calendars

React Native Calendar Components 🗓️ 📆
MIT License
9.53k stars 2.95k forks source link

How to change date locale to shamsi/persian #2025

Closed 1mehdifaraji closed 1 year ago

1mehdifaraji commented 2 years ago

Description

Right now the calendar date timezone locale is gregorian , but I want to change timezone to locale to middle east country date locale like turkey or iran .

Expected Behavior

I provided fa which is locale for farsi/persian iranian shamsi calendar according to List of locale names like this :

import { LocaleConfig } from "react-native-calendars";

LocaleConfig.locales["fa"] = {
  monthNames: [
    "فروردین",
    "اردیبهشت",
    "خرداد",
    "تیر",
    "مرداد",
    "شهریور",
    "مهر",
    "آبان",
    "آذر",
    "دی",
    "بهمن",
    "اسفند",
  ],
  monthNamesShort: [
    "فروردین",
    "اردیبهشت",
    "خرداد",
    "تیر",
    "مرداد",
    "شهریور",
    "مهر",
    "آبان",
    "آذر",
    "دی",
    "بهمن",
    "اسفند",
  ],
  dayNames: [
    "شنبه",
    "یکشنبه",
    "دوشنبه",
    "سه شنبه",
    "چهارشنبه",
    "پنجشنبه",
    "جمعه",
  ],
  dayNamesShort: [
    "شنبه",
    "یکشنبه",
    "دوشنبه",
    "سه شنبه",
    "چهارشنبه",
    "پنجشنبه",
    "جمعه",
  ],
  today: "شنبه",
};
LocaleConfig.defaultLocale = "fa";

Observed Behavior

Screen Shot 1401-06-17 at 20 20 50

But timezone doesn't change . Basically I want the calendar format to be persian like this :

Screen Shot 1401-06-17 at 20 09 12 Screen Shot 1401-06-17 at 20 10 09
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

farzanm14 commented 3 months ago

Could you let me know if you found any proper solution? @1mehdifaraji

1mehdifaraji commented 3 months ago

@farzanm14 I couldn't find a way to fix the problem. Issue still exists.