TIP #444: ADD "WEEKDAYS" UNIT IN CLOCK ADD ============================================ Version: $Revision: 1.6 $ Author: Pietro Cerutti State: Final Type: Project Tcl-Version: 8.7 Vote: Done Created: Tuesday, 23 February 2016 URL: https://tip.tcl-lang.org444.html Post-History: ------------------------------------------------------------------------- ABSTRACT ========== This TIP proposes an enhancement to the *clock add* command to support performing days arithmetic using weekdays only. RATIONALE =========== The *clock add* command allows to perform time arithmetic using a variety of time units, including days. However, it offers no easy way to skip weekends. It is often desired to perform weekdays arithmetic that involves adding or subtracting a number of non-weekend days to a certain date. This is useful in example when computing delivery dates. PROPOSAL ========== The *weekdays* time-unit is added to the list accepted by the *clock add* command. The *count* argument represents weekdays (Mon-Fri) to be added (or subtracted in case of a negative value) to the date. The result of adding weekdays to a date is never a weekend day, unless the starting day is itself a weekend day and *count* is 0. REFERENCE IMPLEMENTATION ========================== Available at DISCUSSION ============ A point has been raised as to whether /weekday/ is unambiguous enough. For instance, in Sweden there seems to be some disagreement on whether the translation /vardag/ includes Saturdays. As an alternative, the term /workday/ has been mentioned. This, however, has the downside of introducing the concept of working days vs. public holiday. Also, the working week is not Mon-Fri in all countries, see []. TIP does not try to accomodate locale-specific features and characteristics. For this reason, it seems best to stick to /weekday/ as the name of the unit and specifically mention that (Mon-Fri) is intended in the documentation. COPYRIGHT =========== This document has been placed in the public domain. ------------------------------------------------------------------------- TIP AutoGenerator - written by Donal K. Fellows