wix / react-native-calendars

React Native Calendar Components πŸ—“οΈ πŸ“†
MIT License
9.52k stars 2.95k forks source link

I found issue in timeline EventBlock.js component where XDate uses wrong format for formatting date in 12 h format. #2264

Open pawan-pk opened 1 year ago

pawan-pk commented 1 year ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-calendars@1.1297.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-calendars/src/timeline/EventBlock.js b/node_modules/react-native-calendars/src/timeline/EventBlock.js
index 8008c86..72c3c39 100644
--- a/node_modules/react-native-calendars/src/timeline/EventBlock.js
+++ b/node_modules/react-native-calendars/src/timeline/EventBlock.js
@@ -8,7 +8,7 @@ const EventBlock = (props) => {
     // Fixing the number of lines for the event title makes this calculation easier.
     // However it would make sense to overflow the title to a new line if needed
     const numberOfLines = Math.floor(event.height / TEXT_LINE_HEIGHT);
-    const formatTime = format24h ? 'HH:mm' : 'hh:mm A';
+    const formatTime = format24h ? 'HH:mm' : 'hh:mm TT';
     const eventStyle = useMemo(() => {
         return {
             left: event.left,

This issue body was partially generated by patch-package.

stale[bot] commented 12 months 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.