itube-specs 0.0.516 → 0.0.518

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,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.516",
4
+ "version": "0.0.518",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
@@ -8,7 +8,7 @@ export const convertDateToTimestamp = () => {
8
8
  return null;
9
9
  }
10
10
 
11
- const date = new Date(year, month - 1, day);
11
+ const date = new Date(Date.UTC(year, month - 1, day));
12
12
  if (isNaN(date.getTime())) {
13
13
  return null;
14
14
  }
@@ -23,9 +23,9 @@ export const convertDateToTimestamp = () => {
23
23
  const fromUnix = (timestamp: number): string => {
24
24
  const date = new Date(timestamp * 1000);
25
25
 
26
- const yyyy = date.getFullYear();
27
- const mm = String(date.getMonth() + 1).padStart(2, '0'); // месяцы с 0
28
- const dd = String(date.getDate()).padStart(2, '0');
26
+ const yyyy = date.getUTCFullYear();
27
+ const mm = String(date.getUTCMonth() + 1).padStart(2, '0');
28
+ const dd = String(date.getUTCDate()).padStart(2, '0');
29
29
 
30
30
  return `${yyyy}-${mm}-${dd}`;
31
31
  };
@@ -1,9 +1,9 @@
1
1
  export function formatDate(seconds: number): string {
2
2
  const date = new Date(1000 * seconds);
3
3
 
4
- const day = date.getDate();
5
- const month = date.getMonth() + 1;
6
- const year = date.getFullYear();
4
+ const day = date.getUTCDate();
5
+ const month = date.getUTCMonth() + 1;
6
+ const year = date.getUTCFullYear();
7
7
 
8
8
  const formattedDay = String(day).padStart(2, '0');
9
9
  const formattedMonth = String(month).padStart(2, '0');