native-pytech 1.0.13 → 1.0.17
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.
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
export declare const addProps: (element: React.ReactElement | null, additionalStyles?: StyleProp<any>, extraProps?: Record<string, any>) => React.ReactElement | null;
|
|
4
4
|
export declare const numberFormat: (value: number) => string;
|
|
5
5
|
export declare const numberFormatInverted: (value: string) => number;
|
|
6
|
+
export declare const formatDate: (value: string) => string;
|
|
6
7
|
export declare function applyOpacity(color: string, opacity: number): string;
|
|
7
8
|
export declare function adjustLightness(color: string, percentage: number): string;
|
|
8
9
|
export declare const _getDeviceTier: () => "low" | "medium" | "high";
|
|
@@ -30,6 +30,20 @@ export const numberFormatInverted = (value) => {
|
|
|
30
30
|
return 0;
|
|
31
31
|
return isNegative ? -parsed : parsed;
|
|
32
32
|
};
|
|
33
|
+
export const formatDate = (value) => {
|
|
34
|
+
const [year, month, day] = value.split('-').map(Number);
|
|
35
|
+
const date = new Date(year, month - 1, day);
|
|
36
|
+
const monthText = new Intl.DateTimeFormat('es-AR', {
|
|
37
|
+
month: 'long',
|
|
38
|
+
}).format(date);
|
|
39
|
+
const dayText = new Intl.DateTimeFormat('es-AR', {
|
|
40
|
+
day: '2-digit',
|
|
41
|
+
}).format(date);
|
|
42
|
+
const yearText = new Intl.DateTimeFormat('es-AR', {
|
|
43
|
+
year: 'numeric',
|
|
44
|
+
}).format(date);
|
|
45
|
+
return `${monthText} ${dayText}, ${yearText}`;
|
|
46
|
+
};
|
|
33
47
|
export function applyOpacity(color, opacity) {
|
|
34
48
|
try {
|
|
35
49
|
const [r, g, b] = parseToRgba(color); // ignoro alpha original
|