Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • P Plasma Add-ons
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 7
    • Issues 7
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 27
    • Merge requests 27
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PlasmaPlasma
  • Plasma Add-ons
  • Merge requests
  • !264

runners/datetime: add conversion between time zones

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Natalie Clarius requested to merge nclarius/kdeplasma-addons:datetimerunner-converter into master Nov 04, 2022
  • Overview 91
  • Commits 3
  • Pipelines 76
  • Changes 3

Extend the DateTime runner to allow for conversion of a given time between two given time zones.

dt_1

source time zone, input time, target time zone

dt_2

dt_3

optional time zone arguments: default to system time zone to convert between remote and local

dt_4

optional date argument: default to today, otherwise specify date to make it possible to account for DST

I'm not entirely sure about the syntax. Since the runner already has the syntax time <to-timzone>, my thinking was that the most predicable would be if the time zone to display the time in is likewise positioned after the time, and then the time zone on which the input time is based positioned before the time, i.e.

<from-timzone> <time> <to-timezone>

But maybe it would better to have a syntax like

<time> <from-timezone> in <to-timezone>

like in the unit conversion runner? I don't have a strong opinion on this.

This change also includes some modifications to how the results are added and displayed:

  • Results are given a relevance based on the match overlap length so that e.g. with query "gmt+1", "GMT+14" wouldn't be higher up than "GMT+1"
  • More time zone formats are sourced to match the query: find zones by short name or offset name
  • Long lines will be wrapped rather than elided
  • Times are displayed without the full date and instead with a label "+1 d"/"-1 d" if applicable for quicker readability
Edited Nov 07, 2022 by Natalie Clarius
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: datetimerunner-converter