Skip to content

Instantly share code, notes, and snippets.

@yyamasak
Created February 12, 2020 09:06
Show Gist options
  • Save yyamasak/a052af582fec673ee1a1720665ef87c1 to your computer and use it in GitHub Desktop.
Save yyamasak/a052af582fec673ee1a1720665ef87c1 to your computer and use it in GitHub Desktop.
tcllib widget::dateentry patch to 0.96
150,152c150,157
< set now [clock seconds]
< set x [clock format $now -format "%d/%m%/%Y"]
< set rawDate [clock scan "$x 00:00:00" -format "%d/%m%/%Y %H:%M:%S"]
---
> if {[info exists $options(-textvariable)]} {
> set x [set $options(-textvariable)]
> set rawDate [clock scan "$x" -format $options(-dateformat)]
> } else {
> set now [clock seconds]
> set x [clock format $now -format "%d/%m%/%Y"]
> set rawDate [clock scan "$x 00:00:00" -format "%d/%m%/%Y %H:%M:%S"]
> }
@yyamasak
Copy link
Author

The value set to the variable specified by -textvariable does not set the initial date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment