accomadesc 0.3.32 → 0.3.34

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.
@@ -81,6 +81,20 @@
81
81
  inputDatesEngaged = false;
82
82
  };
83
83
 
84
+ let travelDates = $derived.by(() => {
85
+ if (arrival && leave) {
86
+ if (formatDateFunc) {
87
+ return `${formatDateFunc(arrival)} - ${formatDateFunc(leave)}`;
88
+ } else {
89
+ const formattedArrival = arrival.toFormat('yyyy-MM-dd');
90
+ const formattedLeave = leave.toFormat('yyyy-MM-dd');
91
+ return `${formattedArrival} - ${formattedLeave}`;
92
+ }
93
+ } else {
94
+ return '';
95
+ }
96
+ });
97
+
84
98
  const createRequest = async (e: SubmitEvent) => {
85
99
  sending = true;
86
100
  e.preventDefault();
@@ -111,7 +125,11 @@
111
125
  console.log('Error sending request', e);
112
126
  }
113
127
 
128
+ arrival = undefined;
129
+ leave = undefined;
130
+ inputDatesEngaged = false;
114
131
  sending = false;
132
+
115
133
  setTimeout(() => {
116
134
  errored = false;
117
135
  successfullySent = false;
@@ -170,9 +188,7 @@
170
188
  iconName="edit"
171
189
  size={1.8}
172
190
  clicked={engageDateInput}
173
- text={arrival && leave && formatDateFunc
174
- ? `${formatDateFunc(arrival)} - ${formatDateFunc(leave)}`
175
- : ''}
191
+ text={travelDates}
176
192
  />
177
193
  {#if arrival && leave}
178
194
  <Button iconName="delete" size={1.8} clicked={dateDeleted} />
@@ -205,7 +205,6 @@
205
205
  <div class="wrapper">
206
206
  <section class="occuplan-wrapper" style="max-width: {maxWidth}; width: 100%;">
207
207
  <header class="occupation-plan-header">
208
- {rfMonth}
209
208
  <div class="header-controls">
210
209
  {#if rfMonth >= minDate}
211
210
  <Button text={prevPage} clicked={prevClicked} preventDefault={true} />
@@ -77,7 +77,6 @@ export const firstMonthValid = (value) => {
77
77
  };
78
78
  export const realFirstMonth = (firstMonth, firstMonthYear, numberOfMonth, page) => {
79
79
  const monthToAdd = page * numberOfMonth;
80
- console.log(firstMonth, firstMonthYear, numberOfMonth, page);
81
80
  if (typeof firstMonth === 'number') {
82
81
  const intValue = firstMonth;
83
82
  if (intValue >= 1 && intValue <= 12) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accomadesc",
3
- "version": "0.3.32",
3
+ "version": "0.3.34",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.test.*",