Skip to content

[FLW-Mobile-App] Bug: Dashboard incorrectly shows forms as incomplete due to strict date format parsing in VLFRepo #158

@vibhutomer

Description

@vibhutomer

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:

  • VLFRepo.kt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions