Re: [go-nuts] time/format: how to add custom formats (24-hour without 0 padding)

2017-07-02 Thread ikedamdam
> I don’t see an obvious way of expressing the example hour (15) in a way that would imply “24 hour format, but no zero padding”. I agree with that. It's difficult to decide an example format for 24-hour without zero padding as a part of the standard feature. And that makes me believe the custo

Re: [go-nuts] time/format: how to add custom formats (24-hour without 0 padding)

2017-07-01 Thread David Collier-Brown
This looks good: if there is a mechanism to align times with language, it should be the implementation of Canadian French (along with things like circiumflex-E) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

Re: [go-nuts] time/format: how to add custom formats (24-hour without 0 padding)

2017-07-01 Thread Jakob Borg
I think this would be difficult to do correctly, given the (very unusual) choice of using an example time as the format string. I don’t see an obvious way of expressing the example hour (15) in a way that would imply “24 hour format, but no zero padding”. //jb On 1 Jul 2017, at 19:01, "ikedam.

Re: [go-nuts] time/format: how to add custom formats (24-hour without 0 padding)

2017-07-01 Thread ikedamdam
Thanks for the answer. I believe it would be nice if custom formats can be added by developers. Does it make sense to create a pull request for time/format to allow developers add custom formats? Custom formats can be defined if I could extend `nextStdChunk` (extracting `std` from layouts) and

Re: [go-nuts] time/format: how to add custom formats (24-hour without 0 padding)

2017-07-01 Thread Sam Whited
On Sat, Jul 1, 2017 at 11:01 AM, Sam Whited wrote: > Check out the documentation for the "Format" function: Follow up because I only answered part of the question (my apologies): unfortunately, while Format does allow you to add custom formats, it won't let you change the padding for 24-hour form

Re: [go-nuts] time/format: how to add custom formats (24-hour without 0 padding)

2017-07-01 Thread Sam Whited
On Sat, Jul 1, 2017 at 2:39 AM, wrote: > Is there a way to extend time/format and add custom formats? Check out the documentation for the "Format" function: https://godoc.org/time#Time.Format —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" gro

[go-nuts] time/format: how to add custom formats (24-hour without 0 padding)

2017-07-01 Thread ikedamdam
Hello, I want to format times like this (for Canadian French users): 06:00 -> 6:00 15:00 -> 15:00 So I want format hours in 24-hour clock without 0 padding. Unfortunately, predefined formats in time/format provides only 0 padded hours for 24-hour clock. Is there a way to extend time/format