Compare commits

...

2 Commits

Author SHA1 Message Date
247010d48f fix(plc zeccetti): changes to improve the timing on the zecetti more to be done 2025-11-07 10:08:56 -06:00
7c40f028c8 fix(historical inv): corrected the way the date can come over to allow for yyyy-mm-dd or with /
the date was coming over in utc format somnetimes and others times local.

close #1 correction to the date formats
2025-11-07 10:08:12 -06:00
6 changed files with 44 additions and 5 deletions

2
.gitignore vendored
View File

@@ -13,6 +13,8 @@ controllerBuilds
# ignoring the old app that will be built into this one to make deploying faster and more easy as we do the migration
lstV2/frontend/.tanstack
mobileLst
# Logs
logs
*.log

14
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach to packager",
"cwd": "${workspaceFolder}",
"type": "reactnative",
"request": "attach"
}
]
}

View File

@@ -5,13 +5,13 @@ meta {
}
get {
url: {{url}}/lst/old/api/eom/histinv?month=2025/11/01
url: {{url}}/lst/old/api/eom/histinv?month=2025-11-01
body: none
auth: inherit
}
params:query {
month: 2025/11/01
month: 2025-11-01
}
settings {

View File

@@ -5,11 +5,15 @@ meta {
}
get {
url: {{url}}/lst/api/forklifts/leases
url: {{url}}/lst/api/forklifts/leases?companyId=b34c6684-ec35-4364-acef-0c1570faf123
body: none
auth: inherit
}
params:query {
companyId: b34c6684-ec35-4364-acef-0c1570faf123
}
body:json {
{
"name":"Delage DLL"

View File

@@ -80,8 +80,27 @@ export const historicalInvByDate = async (
date: string,
includePlantToken: boolean = false,
) => {
const histDate = new Date(date);
console.log(date);
// date format should always be yyyy-MM-dd or yyyy-MM-dd
let splitDate: string[];
if (date.includes("/")) {
splitDate = date.split("/");
} else if (date.includes("-")) {
splitDate = date.split("-");
} else {
return {
success: false,
message: "An invalid date was passed over",
data: [],
};
}
const year = parseInt(splitDate[0], 10);
const month = parseInt(splitDate[1], 10) - 1; // zero-based months
const day = parseInt(splitDate[2], 10);
const histDate = new Date(year, month, day);
console.log(histDate);
console.log(format(histDate, "yyyy-MM-dd"));
const { data, error } = (await tryCatch(
db
.select()

View File

@@ -122,7 +122,7 @@ export const createPlcMonitor = (config: any) => {
`Date being sent to labeler: ${JSON.stringify(zechette)}`,
);
labelingProcess({ zechette: zechette });
}, 1000);
}, 150);
}
});
});