mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-03-28 11:02:40 +00:00
Compare commits
2 Commits
feat/setup
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49cf16278f | ||
|
|
0065e00834 |
16
lib/SvelteUi/app/dist/index.js
vendored
16
lib/SvelteUi/app/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -97,6 +97,16 @@
|
|||||||
configuration.o = arr
|
configuration.o = arr
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function daysInMonth(month) {
|
||||||
|
if (month === 0) return 31;
|
||||||
|
return new Date(2024, month, 0).getDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
function clampDay(dateObj, month) {
|
||||||
|
const max = daysInMonth(month);
|
||||||
|
if (dateObj.d > max) dateObj.d = max;
|
||||||
|
}
|
||||||
|
|
||||||
let moveDown = function(rn) {
|
let moveDown = function(rn) {
|
||||||
let arr = configuration.o;
|
let arr = configuration.o;
|
||||||
if(rn >= arr.length-1) return;
|
if(rn >= arr.length-1) return;
|
||||||
@@ -163,11 +173,11 @@
|
|||||||
<div class="flex flex-wrap mr-3">
|
<div class="flex flex-wrap mr-3">
|
||||||
<select name="rsd" class="in-f" bind:value={c.s.d}>
|
<select name="rsd" class="in-f" bind:value={c.s.d}>
|
||||||
<option value={0}>-</option>
|
<option value={0}>-</option>
|
||||||
{#each {length: 31} as _,i}
|
{#each {length: daysInMonth(c.s.m)} as _,i}
|
||||||
<option value={i+1}>{i+1}</option>
|
<option value={i+1}>{i+1}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
<select name="rsm" class="in-m" bind:value={c.s.m}>
|
<select name="rsm" class="in-m" bind:value={c.s.m} on:change={() => clampDay(c.s, c.s.m)}>
|
||||||
<option value={0}>-</option>
|
<option value={0}>-</option>
|
||||||
{#each {length: 12} as _,i}
|
{#each {length: 12} as _,i}
|
||||||
<option value={i+1}>{translations.months ? translations.months?.[i] : zeropad(i+1)}</option>
|
<option value={i+1}>{translations.months ? translations.months?.[i] : zeropad(i+1)}</option>
|
||||||
@@ -176,11 +186,11 @@
|
|||||||
<input class="in-m" disabled value="to" style="width: 20px;color:#888;"/>
|
<input class="in-m" disabled value="to" style="width: 20px;color:#888;"/>
|
||||||
<select name="red" class="in-m" bind:value={c.e.d}>
|
<select name="red" class="in-m" bind:value={c.e.d}>
|
||||||
<option value={0}>-</option>
|
<option value={0}>-</option>
|
||||||
{#each {length: 31} as _,i}
|
{#each {length: daysInMonth(c.e.m)} as _,i}
|
||||||
<option value={i+1}>{i+1}</option>
|
<option value={i+1}>{i+1}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
<select name="rem" class="in-l" bind:value={c.e.m}>
|
<select name="rem" class="in-l" bind:value={c.e.m} on:change={() => clampDay(c.e, c.e.m)}>
|
||||||
<option value={0}>-</option>
|
<option value={0}>-</option>
|
||||||
{#each {length: 12} as _,i}
|
{#each {length: 12} as _,i}
|
||||||
<option value={i+1}>{translations.months ? translations.months?.[i] : zeropad(i+1)}</option>
|
<option value={i+1}>{translations.months ? translations.months?.[i] : zeropad(i+1)}</option>
|
||||||
|
|||||||
Reference in New Issue
Block a user