@umituz/react-native-design-system 2.6.119 → 2.6.120
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 +1 -1
- package/src/timezone/domain/entities/Timezone.ts +2 -2
- package/src/timezone/index.ts +1 -1
- package/src/timezone/infrastructure/services/CalendarManager.ts +3 -3
- package/src/timezone/infrastructure/services/TimezoneService.ts +1 -1
- package/src/timezone/presentation/hooks/useTimezone.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.120",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone and offline utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -31,7 +31,7 @@ export interface TimezoneInfo {
|
|
|
31
31
|
* Calendar day representation
|
|
32
32
|
* Generic structure - can be extended by apps for app-specific data
|
|
33
33
|
*/
|
|
34
|
-
export interface
|
|
34
|
+
export interface TimezoneCalendarDay {
|
|
35
35
|
/** Date object for this day */
|
|
36
36
|
date: Date;
|
|
37
37
|
|
|
@@ -86,7 +86,7 @@ export interface ITimezoneService {
|
|
|
86
86
|
): string;
|
|
87
87
|
|
|
88
88
|
/** Get calendar days for a month */
|
|
89
|
-
getCalendarDays(year: number, month: number):
|
|
89
|
+
getCalendarDays(year: number, month: number): TimezoneCalendarDay[];
|
|
90
90
|
|
|
91
91
|
/** Check if date is today */
|
|
92
92
|
isToday(date: Date | string | number): boolean;
|
package/src/timezone/index.ts
CHANGED
|
@@ -12,8 +12,8 @@ export class CalendarManager {
|
|
|
12
12
|
year: number,
|
|
13
13
|
month: number,
|
|
14
14
|
formatDateFn: (date: Date) => string,
|
|
15
|
-
):
|
|
16
|
-
const days:
|
|
15
|
+
): TimezoneTimezoneCalendarDay[] {
|
|
16
|
+
const days: TimezoneTimezoneCalendarDay[] = [];
|
|
17
17
|
const firstDay = new Date(year, month, 1);
|
|
18
18
|
const firstDayOfWeek = firstDay.getDay();
|
|
19
19
|
const lastDay = new Date(year, month + 1, 0);
|
|
@@ -57,7 +57,7 @@ export class CalendarManager {
|
|
|
57
57
|
isCurrentMonth: boolean,
|
|
58
58
|
today: Date,
|
|
59
59
|
formatDateFn: (date: Date) => string,
|
|
60
|
-
):
|
|
60
|
+
): TimezoneCalendarDay {
|
|
61
61
|
return {
|
|
62
62
|
date,
|
|
63
63
|
day: date.getDate(),
|
|
@@ -40,7 +40,7 @@ export class TimezoneService implements ITimezoneService {
|
|
|
40
40
|
return this.formatter.formatDateTime(date, locale, options);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
getCalendarDays(year: number, month: number):
|
|
43
|
+
getCalendarDays(year: number, month: number): TimezoneCalendarDay[] {
|
|
44
44
|
return this.calendar.getCalendarDays(year, month, (d) => this.formatter.formatDateToString(d));
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
import { useMemo, useCallback } from 'react';
|
|
9
9
|
import { useLocalization } from '@umituz/react-native-localization';
|
|
10
10
|
import { timezoneService } from '../../infrastructure/services/TimezoneService';
|
|
11
|
-
import type { TimezoneInfo,
|
|
11
|
+
import type { TimezoneInfo, TimezoneCalendarDay } from '../../domain/entities/Timezone';
|
|
12
12
|
|
|
13
13
|
export interface UseTimezoneReturn {
|
|
14
14
|
timezone: string;
|
|
15
15
|
timezoneInfo: TimezoneInfo;
|
|
16
16
|
formatDate: (date: Date, options?: Intl.DateTimeFormatOptions) => string;
|
|
17
17
|
formatTime: (date: Date, options?: Intl.DateTimeFormatOptions) => string;
|
|
18
|
-
getCalendarDays
|
|
18
|
+
getCalendarDays(year: number, month: number): TimezoneCalendarDay[];
|
|
19
19
|
isToday: (date: Date) => boolean;
|
|
20
20
|
isSameDay: (date1: Date, date2: Date) => boolean;
|
|
21
21
|
addDays: (date: Date, days: number) => Date;
|