1
0

Add workaround for timezones on windows (#151)

Add workaround for timezones on windows

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/151
This commit is contained in:
konrad
2020-03-09 22:41:08 +00:00
parent 7de26a462f
commit 4472020ee9
46 changed files with 1613 additions and 6966 deletions

1
vendor/4d63.com/tz/.gitignore generated vendored Normal file
View File

@ -0,0 +1 @@
zoneinfo/

12
vendor/4d63.com/tz/.travis.yml generated vendored Normal file
View File

@ -0,0 +1,12 @@
language: go
go:
- "1.x"
go_import_path: 4d63.com/tz
script:
- go test -coverprofile=coverage.txt
after_success:
- bash <(curl -s https://codecov.io/bash)

53
vendor/4d63.com/tz/LICENSE generated vendored Normal file
View File

@ -0,0 +1,53 @@
MIT License
Copyright (c) 2018 Leigh McCulloch
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
--------------------------------------------------------------------------------
zoneinfo.go generated from /lib/time/zoneinfo.zip from Go.
Copyright (c) 2009 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

19
vendor/4d63.com/tz/README.md generated vendored Normal file
View File

@ -0,0 +1,19 @@
# tz
[![Build Status](https://img.shields.io/travis/leighmcculloch/go-tz.svg)](https://travis-ci.org/leighmcculloch/go-tz)
[![Codecov](https://img.shields.io/codecov/c/github/leighmcculloch/go-tz.svg)](https://codecov.io/gh/leighmcculloch/go-tz)
[![Go Report Card](https://goreportcard.com/badge/github.com/leighmcculloch/go-tz)](https://goreportcard.com/report/github.com/leighmcculloch/go-tz)
[![Go docs](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/4d63.com/tz)
Predictably load `time.Location`s regardless of operating system.
```
import "4d63.com/tz"
```
```
loc, err := tz.LoadLocation("Australia/Sydney")
```
Docs and examples at https://godoc.org/4d63.com/tz.
This package exists because of https://github.com/golang/go/issues/21881.

5
vendor/4d63.com/tz/go.mod generated vendored Normal file
View File

@ -0,0 +1,5 @@
module 4d63.com/tz
go 1.13
require 4d63.com/embedfiles v0.0.0-20190311033909-995e0740726f

2
vendor/4d63.com/tz/go.sum generated vendored Normal file
View File

@ -0,0 +1,2 @@
4d63.com/embedfiles v0.0.0-20190311033909-995e0740726f h1:oyYjGRBNq1TxAIG8aHqtxlvqUfzdZf+MbcRb/oweNfY=
4d63.com/embedfiles v0.0.0-20190311033909-995e0740726f/go.mod h1:HxEsUxoVZyRxsZML/S6e2xAuieFMlGO0756ncWx1aXE=

5
vendor/4d63.com/tz/tools.go generated vendored Normal file
View File

@ -0,0 +1,5 @@
// +build tools
package tz
import _ "4d63.com/embedfiles"

38
vendor/4d63.com/tz/tz.go generated vendored Normal file
View File

@ -0,0 +1,38 @@
// Package tz contains time zone info so that you can predictably load
// Locations regardless of the locations available on the locally running
// operating system.
//
// The stdlib time.LoadLocation function loads timezone data from the operating
// system or from zoneinfo.zip in a local Go installation. Both of these are
// often missing from some operating systems, especially Windows.
//
// This package has the zoneinfo.zip from Go embedded into the package so that
// queries to load a location always return the same data regardless of
// operating system.
//
// This package exists because of https://github.com/golang/go/issues/21881.
package tz // import "4d63.com/tz"
import (
"errors"
"time"
)
//go:generate rm -fr zoneinfo
//go:generate unzip -q $GOROOT/lib/time/zoneinfo.zip -d zoneinfo/
//go:generate go run 4d63.com/embedfiles -out=zoneinfo.go -pkg=tz zoneinfo/
func tzData(name string) ([]byte, bool) {
data, ok := files["zoneinfo/"+name]
return data, ok
}
func LoadLocation(name string) (*time.Location, error) {
if name == "" || name == "UTC" || name == "Local" {
return time.LoadLocation(name)
}
if tzdata, ok := tzData(name); ok {
return time.LoadLocationFromTZData(name, tzdata)
}
return nil, errors.New("unknown location " + name)
}

1194
vendor/4d63.com/tz/zoneinfo.go generated vendored Normal file

File diff suppressed because one or more lines are too long