goodsign / monday Goto Github PK
View Code? Open in Web Editor NEWMonday is a minimalistic l10n, i18n package for translation of month and day of week names in time.Date objects.
License: BSD 2-Clause "Simplified" License
Monday is a minimalistic l10n, i18n package for translation of month and day of week names in time.Date objects.
License: BSD 2-Clause "Simplified" License
Hi. Thank you for your amazing work!
Unfortunately, your project's license doesn't satisfy the license checks.
Because of this, it's impossible to see the project's documentation in proper format at https://pkg.go.dev/github.com/goodsign/monday.
I suggest checking out the Google's policy page to find out why it's happening and what should be done in order fo fix this: https://pkg.go.dev/license-policy
Line 53 in 534cfb3
Hello!
"November" in romanian is "Noiembrie" and so the abbreviation should be "noi" not "nov".
I would really appreciate the fix as I'm using romanian months abbreviations in my service :)
Thank you!
Hi,
Would it be possible to publish a new release? I like your package a lot and am using it in a web scraper project. Among others I'd like to use the locale sk_SK
which is already supported by the code but the latest release 1.0.1 does not yet include this locale if I'm not mistaken. It would be awesome if you could publish a new release with the latest changes. Thanks in advance! :)
Cheers, Jakob
Carbon is a simple, semantic and developer-friendly golang package for datetime, it has been included by awesome-go
Line 152 in 9bcb46a
Im not sure but I think this is a Typo.
Mondayen → Monday
I wanted to Replace "Monday" with "(Mon)" in goodsign/monday/default_formats.go -> FullFormatsByLocale.
But this one seems different style then others.
The package currently depends on package github.com/fatih/set.v0
but it is no longer maintained and could pose a risk for this projects health in case of the repository being deleted.
Would you consider it possible to avoid this dependency over all? It's used in monday.LocaleDetector
. After looking breifly in the source code it seems to be possible to replace it with a standard map[string]monday.Locale
map?
I am getting a time.ParseError when I run ParseInLocation for dates in Japanese.
Variables:
I call the function
t, err = monday.ParseInLocation(layout, s, loc, l)
Error msg:
parsing time "発売予定日は2020年March25日です。" as "発売予定日は2006年1月2日です。": cannot parse "March25日です。" as "1"
Work around:
I comment out line 76-79 in format_ja_jp.go
// for k, v := range knownMonthsLongReverse[locale] {
// value = strings.Replace(value, k, v, -1)
// }
Please let me know if you need any more information.
Thanks,
Luke
It would be great if this library had Arabic support. What do you think about that?
day := 10
monday.Format(
time.Date(2020, time.June, day, 0, 0, 0, 0, time.Local),
"_2 January 2006", monday.LocalePtPT)
The code above does not translate month on day>=10
I can't clone this repo with 'go get'. It has undefined variables:
$ go get github.com/goodsign/monday
./monday.go:319: undefined: longDayNamesCsCZ
./monday.go:320: undefined: shortDayNamesCsCZ
./monday.go:321: undefined: longMonthNamesCsCZ
./monday.go:322: undefined: shortMonthNamesCsCZ
./monday.go:323: undefined: longMonthNamesGenitiveCsCZ
./monday.go:324: undefined: shortMonthNamesGenitiveCsCZ
Can you take a look please
Hello,
Could you add go modules in your project ?
Thank you.
PS: And thank you for this amazing library 🙂
Hi!
I followed the example, but can't get, how to make date look like "20 may" for "2020-05-20". In particularly I'm interested in Russian version. I tried:
monday.Format(time.Now(), "02 Jan 06 15:04 MST", monday.LocaleRuRU)
but it returns empty string. (But I expect 20 мая 20 15:04 MST
)
The format that works is 2006-01-02
, but it's not what I want. Could you please elaborate on examples in Readme (because there is only one simple) or point out what I am doing wrong.
Thanks!
Hi,
Thank you for this project.
I believe some API changes can increase the performance and resource usage. For example, a log file must contain same date layout. Instead of using "Parse" method for each date value, we can detect the locale only one time, and then we can call "ParseInLocation" directly to improve parse process. But right now, locale etc is private fields. So it's not exposed to us, and makes it impossible to change the logic.
If we can make the "LastLocale" field public. after first detection, we can get store the Locale and then call the "ParseInLocation" directly.
Thanks again.
A few months back I searched around for l10n solutions specifically related to date/time in go. I stumbled upon this package, but cannot remember exactly how I found it. Put it in the back of my mind for later. Today I needed to find it again and started googling. Tried a number of searches and could not find it. First I though it had been removed, but then I remembered that I forked it earlier, and found it that way.
I think you should consider adding some more search-friendly keywords at the top of the readme to increase visibility. Both l10n
and i18n
should be there I think. Also, I am not quite sure what settings are available on a github repo to allow or disallow indexing by search engines. Perhaps something could be opened up there? During my searching I even tried searching for Swedish month names, but that did not help. So I am guessing that google does not index the source code. This search for example, for the Swedish word for "monday", finds 0 results:
site:github.com/goodsign/monday måndag
Just FYI, here are some of the searches I did, none of which found the monday package:
site:github.com golang "september" "oktober" "november"
go date l10n package
golang date l10n package
golang time l10n package
go time localization package
golang date i18n site:github.com
golang international month names site:github.com
golang international month names```
text.Scanner
is outputting errors. Such as:
<input>:1:1: literal not terminated
<input>:1:1: invalid char literal
<input>:1:1: literal not terminated
<input>:1:1: invalid char literal
Such as when I use tokens like '
':
layoutData{
layout: "' Mon, 2 Jan 2006 15:4:5 -0700",
matches: []string{
"' Нд, 22 Гру 2019 00:35:44 +0200",
},
unmatches: []string{},
locales: []Locale{
LocaleUkUA,
LocaleRuRU,
LocaleEnUS,
LocaleEnUS,
},
},
I believe this is because text.Scanner
is build to parse go tokens for a compiler.
Which technically means I should be able to break tests by passing in tokens like /*
and when it /could/ be a valid format string.
Ie:
package main
import (
"fmt"
"github.com/goodsign/monday"
"time"
)
func main() {
fmt.Println(time.Parse("/* Mon, 02 Jan 2006 15:04:05 */", "/* Mon, 02 Nov 2007 17:42:36 */"))
fmt.Println(monday.NewLocaleDetector().Parse("/* Mon, 02 Jan 2006 15:04:05 */", "/* Mon, 02 Nov 2007 17:42:36 */"))
fmt.Println(time.Parse(".. Mon, 02 Jan 2006 15:04:05 ..", ".. Mon, 02 Nov 2007 17:42:36 .."))
fmt.Println(monday.NewLocaleDetector().Parse(".. Mon, 02 Jan 2006 15:04:05 ..", ".. Mon, 02 Nov 2007 17:42:36 .."))
}
Outputs:
2007-11-02 17:42:36 +0000 UTC <nil>
0001-01-01 00:00:00 +0000 UTC parsing time "/* Mon, 02 Nov 2007 17:42:36 */"'/* Mon, 02 Nov 2007 17:42:36 */' not matches to '/* Mon, 02 Jan 2006 15:04:05 */' last error position = 0
2007-11-02 17:42:36 +0000 UTC <nil>
2007-11-02 17:42:36 +0000 UTC <nil>
Hey! I'm using this package in my project, but unfortunately i didn't find the kazakh locale
it would be great if this package will support kazakh locale
P.S PR is ready
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.