@umituz/react-native-subscription 2.14.94 → 2.14.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-subscription",
3
- "version": "2.14.94",
3
+ "version": "2.14.95",
4
4
  "description": "Complete subscription management with RevenueCat, paywall UI, and credits system for React Native apps",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -35,7 +35,8 @@
35
35
  "@umituz/react-native-design-system": "latest",
36
36
  "@umituz/react-native-firebase": "latest",
37
37
  "@umituz/react-native-localization": "latest",
38
- "@umituz/react-native-storage": "latest"
38
+ "@umituz/react-native-storage": "latest",
39
+ "@umituz/react-native-timezone": "latest"
39
40
  },
40
41
  "peerDependencies": {
41
42
  "@tanstack/react-query": ">=5.0.0",
@@ -12,6 +12,7 @@ import {
12
12
  AtomicText,
13
13
  AtomicIcon,
14
14
  } from "@umituz/react-native-design-system";
15
+ import { timezoneService } from "@umituz/react-native-timezone";
15
16
  import type { CreditLog, TransactionReason } from "../../domain/types/transaction.types";
16
17
 
17
18
  export interface TransactionItemTranslations {
@@ -46,14 +47,7 @@ const getReasonIcon = (reason: TransactionReason): string => {
46
47
  };
47
48
 
48
49
  const defaultDateFormatter = (timestamp: number): string => {
49
- const date = new Date(timestamp);
50
- const d = String(date.getDate()).padStart(2, '0');
51
- const m = String(date.getMonth() + 1).padStart(2, '0');
52
- const y = date.getFullYear();
53
- const th = String(date.getHours()).padStart(2, '0');
54
- const tm = String(date.getMinutes()).padStart(2, '0');
55
-
56
- return `${d}.${m}.${y} ${th}:${tm}`;
50
+ return timezoneService.formatToDisplayDateTime(new Date(timestamp));
57
51
  };
58
52
 
59
53
  export const TransactionItem: React.FC<TransactionItemProps> = ({
@@ -1,3 +1,5 @@
1
+ import { timezoneService } from "@umituz/react-native-timezone";
2
+
1
3
  /**
2
4
  * Converts Firestore timestamp or Date to ISO string
3
5
  */
@@ -17,22 +19,18 @@ export const convertPurchasedAt = (purchasedAt: unknown): string | null => {
17
19
  return null;
18
20
  }
19
21
 
20
- return date.toISOString();
22
+ return timezoneService.formatToISOString(date);
21
23
  };
22
24
 
23
25
  /**
24
- * Formats a date string to a simple DD.MM.YYYY format
26
+ * Formats a date string to a simple DD.MM.YYYY format using timezoneService
25
27
  */
26
28
  export const formatDate = (dateStr: string | null): string | null => {
27
29
  if (!dateStr) return null;
28
30
  const date = new Date(dateStr);
29
31
  if (isNaN(date.getTime())) return null;
30
32
 
31
- const d = String(date.getDate()).padStart(2, '0');
32
- const m = String(date.getMonth() + 1).padStart(2, '0');
33
- const y = date.getFullYear();
34
-
35
- return `${d}.${m}.${y}`;
33
+ return timezoneService.formatToDisplayDate(date);
36
34
  };
37
35
 
38
36