cmdr
Check-in [d993d2bda7]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fixes (defaults, metadata) and extensions (2external) for date/time
Timelines: family | ancestors | descendants | both | more-vtypes
Files: files | file ages | folders
SHA1: d993d2bda781e4e63672d0ca4ff169c5e8e796ae
User & Date: aku 2015-03-06 19:13:47
Context
2015-03-06
19:14
And more vtypes: positive ints, years, and weekdays check-in: 307a15e657 user: aku tags: more-vtypes
19:13
fixes (defaults, metadata) and extensions (2external) for date/time check-in: d993d2bda7 user: aku tags: more-vtypes
01:55
Drafts of new validation types: iso8601 date/time values check-in: d7efe5a253 user: andreask tags: more-vtypes
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to vt_date.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16


17
18
19
20
21
22
23
..
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55





56
57
58
59
60
61
62
63
64
65
66
67
68
## -*- tcl -*-
# # ## ### ##### ######## ############# #####################
## CMDR - Validate::Date - Supporting validation type - iso dates.

# @@ Meta Begin
# Package cmdr::validate::date 0
# Meta author   {Andreas Kupries}
# Meta location https://core.tcl.tk/akupries/cmdr
# Meta platform tcl
# Meta summary     Standard parameter validation type for dates
# Meta description Standard parameter validation type for dates
# Meta subject {command line}
# Meta require {Tcl 8.5-}
# Meta require {cmdr::validate::common 1.2}
# Meta require debug
# Meta require debug::caller


# @@ Meta End

# # ## ### ##### ######## ############# #####################
## Requisites

package require Tcl 8.5
package require cmdr::validate::common 1.2
................................................................................
    namespace ensemble create
}
namespace eval ::cmdr::validate {
    namespace export date
    namespace ensemble create
}
namespace eval ::cmdr::validate::date {
    namespace export default validate complete release
    namespace ensemble create

    namespace import ::cmdr::validate::common::fail
}

# # ## ### ##### ######## ############# #####################

debug define cmdr/validate/date
debug level  cmdr/validate/date
debug prefix cmdr/validate/date {[debug caller] | }

# # ## ### ##### ######## ############# #####################
## Dates as parsed by clock::iso86






proc ::cmdr::validate::date::release  {p x} { return }
proc ::cmdr::validate::date::default  {p}  {
    debug.cmdr/validate/date {}
    # Today.
    return [clock format [clock seconds] -format {%Y-%m-%d}]
}
proc ::cmdr::validate::date::complete {p x} {
    debug.cmdr/validate/date {} 10
    # No completion.
    return {}
}
proc ::cmdr::validate::date::validate {p x} {




|










>
>







 







|













>
>
>
>
>





|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
## -*- tcl -*-
# # ## ### ##### ######## ############# #####################
## CMDR - Validate::Date - Supporting validation type - iso dates.

# @@ Meta Begin
# Package cmdr::validate::date 1
# Meta author   {Andreas Kupries}
# Meta location https://core.tcl.tk/akupries/cmdr
# Meta platform tcl
# Meta summary     Standard parameter validation type for dates
# Meta description Standard parameter validation type for dates
# Meta subject {command line}
# Meta require {Tcl 8.5-}
# Meta require {cmdr::validate::common 1.2}
# Meta require debug
# Meta require debug::caller
# Meta require try
# Meta require clock::iso8601
# @@ Meta End

# # ## ### ##### ######## ############# #####################
## Requisites

package require Tcl 8.5
package require cmdr::validate::common 1.2
................................................................................
    namespace ensemble create
}
namespace eval ::cmdr::validate {
    namespace export date
    namespace ensemble create
}
namespace eval ::cmdr::validate::date {
    namespace export default validate complete release 2external
    namespace ensemble create

    namespace import ::cmdr::validate::common::fail
}

# # ## ### ##### ######## ############# #####################

debug define cmdr/validate/date
debug level  cmdr/validate/date
debug prefix cmdr/validate/date {[debug caller] | }

# # ## ### ##### ######## ############# #####################
## Dates as parsed by clock::iso86

proc ::cmdr::validate::date::2external {x}  {
    debug.cmdr/validate/date {}
    return [clock format $x -format {%Y-%m-%d}]
}

proc ::cmdr::validate::date::release  {p x} { return }
proc ::cmdr::validate::date::default  {p}  {
    debug.cmdr/validate/date {}
    # Today.
    return [clock seconds]
}
proc ::cmdr::validate::date::complete {p x} {
    debug.cmdr/validate/date {} 10
    # No completion.
    return {}
}
proc ::cmdr::validate::date::validate {p x} {

Changes to vt_time.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16


17
18
19
20
21
22
23
..
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55





56
57
58
59
60
61
62
63
64
65
66
67
68
## -*- tcl -*-
# # ## ### ##### ######## ############# #####################
## CMDR - Validate::Time - Supporting validation type - iso times.

# @@ Meta Begin
# Package cmdr::validate::time 0
# Meta author   {Andreas Kupries}
# Meta location https://core.tcl.tk/akupries/cmdr
# Meta platform tcl
# Meta summary     Standard parameter validation type for times
# Meta description Standard parameter validation type for times
# Meta subject {command line}
# Meta require {Tcl 8.5-}
# Meta require {cmdr::validate::common 1.2}
# Meta require debug
# Meta require debug::caller


# @@ Meta End

# # ## ### ##### ######## ############# #####################
## Requisites

package require Tcl 8.5
package require cmdr::validate::common 1.2
................................................................................
    namespace ensemble create
}
namespace eval ::cmdr::validate {
    namespace export time
    namespace ensemble create
}
namespace eval ::cmdr::validate::time {
    namespace export default validate complete release
    namespace ensemble create

    namespace import ::cmdr::validate::common::fail
}

# # ## ### ##### ######## ############# #####################

debug define cmdr/validate/time
debug level  cmdr/validate/time
debug prefix cmdr/validate/time {[debug caller] | }

# # ## ### ##### ######## ############# #####################
## Times as parsed by clock::iso86






proc ::cmdr::validate::time::release  {p x} { return }
proc ::cmdr::validate::time::default  {p}  {
    debug.cmdr/validate/time {}
    # Today.
    return [clock format [clock seconds] -format {%Y-%m-%d}]
}
proc ::cmdr::validate::time::complete {p x} {
    debug.cmdr/validate/time {} 10
    # No completion.
    return {}
}
proc ::cmdr::validate::time::validate {p x} {




|










>
>







 







|













>
>
>
>
>





|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
## -*- tcl -*-
# # ## ### ##### ######## ############# #####################
## CMDR - Validate::Time - Supporting validation type - iso times.

# @@ Meta Begin
# Package cmdr::validate::time 1
# Meta author   {Andreas Kupries}
# Meta location https://core.tcl.tk/akupries/cmdr
# Meta platform tcl
# Meta summary     Standard parameter validation type for times
# Meta description Standard parameter validation type for times
# Meta subject {command line}
# Meta require {Tcl 8.5-}
# Meta require {cmdr::validate::common 1.2}
# Meta require debug
# Meta require debug::caller
# Meta require try
# Meta require clock::iso8601
# @@ Meta End

# # ## ### ##### ######## ############# #####################
## Requisites

package require Tcl 8.5
package require cmdr::validate::common 1.2
................................................................................
    namespace ensemble create
}
namespace eval ::cmdr::validate {
    namespace export time
    namespace ensemble create
}
namespace eval ::cmdr::validate::time {
    namespace export default validate complete release 2external
    namespace ensemble create

    namespace import ::cmdr::validate::common::fail
}

# # ## ### ##### ######## ############# #####################

debug define cmdr/validate/time
debug level  cmdr/validate/time
debug prefix cmdr/validate/time {[debug caller] | }

# # ## ### ##### ######## ############# #####################
## Times as parsed by clock::iso86

proc ::cmdr::validate::time::2external {x}  {
    debug.cmdr/validate/time {}
    return [clock format $x -format {%H:%M:%S}]
}

proc ::cmdr::validate::time::release  {p x} { return }
proc ::cmdr::validate::time::default  {p}  {
    debug.cmdr/validate/time {}
    # Today.
    return [clock seconds]
}
proc ::cmdr::validate::time::complete {p x} {
    debug.cmdr/validate/time {} 10
    # No completion.
    return {}
}
proc ::cmdr::validate::time::validate {p x} {