diff options
author | Teddy Wing | 2017-06-03 18:31:17 +0200 |
---|---|---|
committer | Teddy Wing | 2017-06-03 18:31:17 +0200 |
commit | 6d138ee3c53913ef63565f66fed1b79d339b3230 (patch) | |
tree | 241cd625d36526fdd94a7748c8926700173cb273 /timetask | |
parent | 570118505bc765feda76ddcdcaef3fa0d181ec6b (diff) | |
download | timetasker-6d138ee3c53913ef63565f66fed1b79d339b3230.tar.bz2 |
buildSubmissionParams(): Fix time string replacement bug
We ran into a bug where submitting "7" as the time spent would become
"700" on the site.
This was because our `n` value of 0 wasn't replacing the "." in the
string. Thus "7.00" became "7.00" after the replacement. Not right. I
misunderstood what that argument was doing and what the word "empty" in
the documentation meant.
Change the `n` value to replace all "."s in the string.
Diffstat (limited to 'timetask')
-rw-r--r-- | timetask/http.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/timetask/http.go b/timetask/http.go index f236665..8c41b4f 100644 --- a/timetask/http.go +++ b/timetask/http.go @@ -99,7 +99,7 @@ func buildSubmissionParams(time_entry TimeEntry) url.Values { ) time_str := strconv.FormatFloat(time_entry.Time, 'f', 2, 64) - time_european_format := strings.Replace(time_str, ".", ",", 0) + time_european_format := strings.Replace(time_str, ".", ",", -1) v.Set( "f_time0", time_european_format, |