Evidlo / remarkable_news

Daily news/comics on your reMarkable's suspend screen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

strftime doesnt support %-d

harrylepotter opened this issue · comments

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),
)

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

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