Skip to content

Timesheet default view mode wrong depending on screen #203

Description

@er-vin

For some reason it looks like window.screen.width and window.screen.height aren't trustworthy enough to pick the default value for the timesheet view mode.

Typically right now it reports for me 1280x720 on a screen which is in fact 2560x1440. Due to this it thinks the height is less than 768 and wrongly picks the split weeks mode. Another solution probably needs to be use to decide which default to pick.

My proposal would be to use the orientation media query. Indeed, if you are in landscape you probably want to favor horizontal layout and have the month mode, if you are in portrait you probably want to favor vertical layout and have the split weeks mode.

This could be achieved using something like the following:

let isPortrait = window.matchMedia("(orientation: portrait)").matches 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions