Evidlo / remarkable_news

Daily news/comics on your reMarkable's suspend screen
GNU General Public License v3.0
285 stars 32 forks source link

strftime doesnt support %-d #23

Closed harrylepotter closed 3 years ago

harrylepotter commented 3 years ago

Project-dependent library (https://github.com/lestrrat-go/strftime) doesn't support %-d and %e prefixes with a whitespace. This means that the NYT service doesn't work on 1-9 of each month. I've got a fix for this on my side but it's stupidly hacky and likely to break other things (flag, trimwhitespace).

Noticed the library author is pretty hesitant to add this (..or at least hasn't done anything since march). Not sure if defining a new specification on strftime is feasible or would even fix things:

p, err := strftime.New(
  `%L`,
  strftime.WithSpecification('L', strftime.Milliseconds),
)
Evidlo commented 3 years ago

Not sure when https://github.com/lestrrat-go/strftime/issues/13 is going to get resolved, so I created format code %e which is the same as %-d.

lestrrat commented 3 years ago

Sorry, it looks like I started it and got distracted somewhere along the way, probably lack of tuits/motivation. I'm not against it, but I'll be honest this is not my top priority. PRs are welcome