fix ne storage

This commit is contained in:
Romulus21
2026-03-06 12:07:18 +01:00
parent 0419d64fa1
commit 02f7efa745
2 changed files with 18 additions and 18 deletions

View File

@@ -121,7 +121,7 @@ class RainfallController extends Controller
$diff = now()->diffInMonths($firstOfLastYear); $diff = now()->diffInMonths($firstOfLastYear);
$result = []; $result = [];
for ($i = $diff; $i >= 0; $i--) { for ($i = -$diff; $i >= 0; $i--) {
$date = now()->subMonths($i); $date = now()->subMonths($i);
$month = $date->month; $month = $date->month;
$firstOfMonth = now()->subMonths($i)->firstOfMonth(); $firstOfMonth = now()->subMonths($i)->firstOfMonth();

View File

@@ -46,23 +46,23 @@ const YearRainfall: FC<YearRainfallProps> = ({loadedAt}) => {
<td>{months.find(m => m.year === ((new Date).getFullYear() - 1) && m.month === Number(month))?.values}</td> <td>{months.find(m => m.year === ((new Date).getFullYear() - 1) && m.month === Number(month))?.values}</td>
</tr> </tr>
)} )}
{/*<tr className="font-semibold">*/} <tr className="font-semibold">
{/* <td>Total</td>*/} <td>Total</td>
{/* {Object.entries(data).at(0).at(1).map(i => i.year)*/} {Object.entries(data).at(0).at(1).map(i => i.year)
{/* .sort((a,b) => b > a)*/} .sort((a,b) => b > a)
{/* .map(year => <td key={year}>*/} .map(year => <td key={year}>
{/* {Object.entries(data).reduce((acc, item) => {*/} {Object.entries(data).reduce((acc, item) => {
{/* console.log(item.at(1), year)*/} console.log(item.at(1), year)
{/* item.at(1).forEach(month => {*/} item.at(1).forEach(month => {
{/* console.log(month)*/} console.log(month)
{/* if(month.year === year) {*/} if(month.year === year) {
{/* acc += month.values*/} acc += month.values
{/* }*/} }
{/* })*/} })
{/* return acc*/} return acc
{/* }, 0)}*/} }, 0)}
{/* </td>)}*/} </td>)}
{/*</tr>*/} </tr>
</tbody> </tbody>
</table> </table>
</Card> </Card>