Skip to content

Instantly share code, notes, and snippets.

@yyamasak
Created February 12, 2020 09:06
Show Gist options
  • Select an option

  • Save yyamasak/a052af582fec673ee1a1720665ef87c1 to your computer and use it in GitHub Desktop.

Select an option

Save yyamasak/a052af582fec673ee1a1720665ef87c1 to your computer and use it in GitHub Desktop.

Revisions

  1. yyamasak created this gist Feb 12, 2020.
    13 changes: 13 additions & 0 deletions widget_dateentry.tcl.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    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"]
    > }