@lavalogic/scoria 0.34.0 → 0.36.0

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.
@@ -16,6 +16,7 @@ export declare function generateUUID<T extends string>(): T;
16
16
  export declare function refWrapper<T>(initial: T): RefWrapper<T>;
17
17
  export declare function SQLFriendly(date: InputDate | SQLDate | Date): SQLDate;
18
18
  export declare function SQLFriendlyWithLocalTime(date: InputDate | InputDateWithTime | SQLDate | Date, timeDate?: InputDate | InputDateWithTime | SQLDate | Date | null): SQLDate;
19
+ export declare function SQLFriendlyWithLocalTime_new(date: InputDate | InputDateWithTime | SQLDate | Date, timeDate?: InputDate | InputDateWithTime | SQLDate | Date | null): SQLDate;
19
20
  export declare const localTimeFormat: Intl.DateTimeFormat;
20
21
  export declare function passthrough(e: KeyboardEvent): void;
21
22
  export declare function getCanvasContext(): CanvasRenderingContext2D | null;
@@ -89,6 +89,23 @@ export function SQLFriendlyWithLocalTime(date, timeDate) {
89
89
  .toString()
90
90
  .padStart(2, '0')} ${localTimeFormat.format(timeDate ?? date)}`;
91
91
  }
92
+ //HACK: transition will happen soon. Until then, this format cannot be used in production
93
+ export function SQLFriendlyWithLocalTime_new(date, timeDate) {
94
+ if (typeof date === 'string') {
95
+ // eslint-disable-next-line svelte/prefer-svelte-reactivity
96
+ date = new Date(date);
97
+ }
98
+ if (typeof timeDate === 'string') {
99
+ // eslint-disable-next-line svelte/prefer-svelte-reactivity
100
+ timeDate = new Date(timeDate);
101
+ }
102
+ const d = date;
103
+ const t = (timeDate ?? date);
104
+ const pad = (n) => String(n).padStart(2, '0');
105
+ const off = -t.getTimezoneOffset();
106
+ const sign = off >= 0 ? '+' : '-';
107
+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(t.getHours())}:${pad(t.getMinutes())}:${pad(t.getSeconds())}${sign}${pad(Math.floor(Math.abs(off) / 60))}:${pad(Math.abs(off) % 60)}`;
108
+ }
92
109
  export const localTimeFormat = new Intl.DateTimeFormat('en-GB', {
93
110
  hour: '2-digit',
94
111
  hourCycle: 'h23',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lavalogic/scoria",
3
3
  "description": "Svelte components used for the FloWMS Web Frontend",
4
- "version": "0.34.0",
4
+ "version": "0.36.0",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },
@@ -26,48 +26,48 @@
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@sveltejs/kit": "^2.57.1",
29
- "svelte": "^5.53.5"
29
+ "svelte": "^5.55.7"
30
30
  },
31
31
  "devDependencies": {
32
- "@chromatic-com/storybook": "^5.1.2",
33
- "@eslint/compat": "^2.0.5",
32
+ "@chromatic-com/storybook": "^5.2.1",
33
+ "@eslint/compat": "^2.1.0",
34
34
  "@eslint/js": "^10.0.1",
35
- "@playwright/test": "^1.59.1",
36
- "@storybook/addon-a11y": "^10.3.5",
37
- "@storybook/addon-docs": "^10.3.5",
35
+ "@playwright/test": "^1.60.0",
36
+ "@storybook/addon-a11y": "^10.4.0",
37
+ "@storybook/addon-docs": "^10.4.0",
38
38
  "@storybook/addon-svelte-csf": "^5.1.2",
39
- "@storybook/addon-vitest": "^10.3.5",
40
- "@storybook/sveltekit": "^10.3.5",
39
+ "@storybook/addon-vitest": "^10.4.0",
40
+ "@storybook/sveltekit": "^10.4.0",
41
41
  "@sveltejs/adapter-node": "^5.5.4",
42
- "@sveltejs/kit": "^2.57.1",
42
+ "@sveltejs/kit": "^2.60.1",
43
43
  "@sveltejs/package": "^2.5.7",
44
- "@sveltejs/vite-plugin-svelte": "^7.0.0",
44
+ "@sveltejs/vite-plugin-svelte": "^7.1.2",
45
45
  "@types/eslint": "^9.6.1",
46
- "@types/node": "^25.6.0",
47
- "@typescript-eslint/eslint-plugin": "^8.58.2",
48
- "@typescript-eslint/parser": "^8.58.2",
49
- "@vitest/browser": "^4.1.4",
50
- "@vitest/browser-playwright": "^4.1.4",
51
- "eslint": "^10.2.0",
46
+ "@types/node": "^25.8.0",
47
+ "@typescript-eslint/eslint-plugin": "^8.59.3",
48
+ "@typescript-eslint/parser": "^8.59.3",
49
+ "@vitest/browser": "^4.1.6",
50
+ "@vitest/browser-playwright": "^4.1.6",
51
+ "eslint": "^10.4.0",
52
52
  "eslint-config-prettier": "^10.1.8",
53
- "eslint-plugin-storybook": "^10.3.5",
54
- "eslint-plugin-svelte": "^3.17.0",
55
- "globals": "^17.5.0",
53
+ "eslint-plugin-storybook": "^10.4.0",
54
+ "eslint-plugin-svelte": "^3.17.1",
55
+ "globals": "^17.6.0",
56
56
  "mdsvex": "^0.12.7",
57
- "playwright": "^1.59.1",
57
+ "playwright": "^1.60.0",
58
58
  "prettier": "^3.8.3",
59
- "prettier-plugin-svelte": "^3.5.1",
60
- "publint": "^0.3.18",
61
- "sass-embedded": "^1.99.0",
62
- "storybook": "^10.3.5",
63
- "svelte": "^5.55.4",
64
- "svelte-check": "^4.4.6",
59
+ "prettier-plugin-svelte": "^3.5.2",
60
+ "publint": "^0.3.21",
61
+ "sass": "^1.99.0",
62
+ "storybook": "^10.4.0",
63
+ "svelte": "^5.55.7",
64
+ "svelte-check": "^4.4.8",
65
65
  "svelte-render-scan": "^1.1.0",
66
- "typescript": "^6.0.2",
67
- "typescript-eslint": "^8.58.2",
68
- "vite": "^8.0.8",
66
+ "typescript": "^6.0.3",
67
+ "typescript-eslint": "^8.59.3",
68
+ "vite": "^8.0.13",
69
69
  "vite-plugin-devtools-json": "^1.0.0",
70
- "vitest": "^4.1.4",
70
+ "vitest": "^4.1.6",
71
71
  "vitest-browser-svelte": "^2.1.1"
72
72
  },
73
73
  "keywords": [