Description:
In VLFRepo.kt, the isFormFilledForCurrentMonth() function strictly parses form submission dates using the dd-MM-yyyy format. However, dates synced from the server or generated by other modules frequently use the ISO format (yyyy-MM-dd).
When a date string like 2026-05-12 is passed to the strict formatter, it throws a ParseException. This exception is silently caught, causing the function to incorrectly return false. As a result, the UI falsely indicates to the field worker that their monthly forms are incomplete, despite the data existing in the local database.
Affected File:
Expected Behavior:
The date parser should be flexible enough to handle both dd-MM-yyyy and yyyy-MM-dd formats, accurately reflecting the field worker's completion status on the UI.
Suggested Fix:
Update the isInCurrentMonth helper function to attempt parsing with multiple date formats (similar to the fallback logic used in toMonthKey()) before defaulting to false.
Description:
In
VLFRepo.kt, theisFormFilledForCurrentMonth()function strictly parses form submission dates using thedd-MM-yyyyformat. However, dates synced from the server or generated by other modules frequently use the ISO format (yyyy-MM-dd).When a date string like
2026-05-12is passed to the strict formatter, it throws aParseException. This exception is silently caught, causing the function to incorrectly returnfalse. As a result, the UI falsely indicates to the field worker that their monthly forms are incomplete, despite the data existing in the local database.Affected File:
VLFRepo.ktExpected Behavior:
The date parser should be flexible enough to handle both
dd-MM-yyyyandyyyy-MM-ddformats, accurately reflecting the field worker's completion status on the UI.Suggested Fix:
Update the
isInCurrentMonthhelper function to attempt parsing with multiple date formats (similar to the fallback logic used intoMonthKey()) before defaulting tofalse.