sunjavagroups / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

Support two-digit years #558

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The "time" mode supports only 4-digit years but not 2-digit years.  This would 
be very useful in situations where time periods are only covering a handful of 
years and the extra 20- or 19- just takes up additional space.

Attached is a patch that maintains current format options but also allows users 
to specify "Y" for a 2-digit year ("y" is currently used for a 4-digit year) 
when setting the date format for an axis.

Original issue reported on code.google.com by e...@eam.me on 21 Jun 2011 at 7:06

Attachments:

GoogleCodeExporter commented 8 years ago
Also, this is not a defect, but an enhancement ... please update the ticket 
accordingly.

Original comment by e...@eam.me on 21 Jun 2011 at 7:07

GoogleCodeExporter commented 8 years ago
Hi.

It's been a while since this patch was submitted, and it's just what I need. 
I'd prefer to have it built in rather than hack it into my copy.

Original comment by Anthony....@gmail.com on 13 Feb 2012 at 9:55

GoogleCodeExporter commented 8 years ago
shouldn't Y be for a 4 digit year and y for 2?

I realise that would alter backwards compatibility but would be using a 
standard date formatting value

Original comment by gptaylor84 on 15 Feb 2012 at 10:58

GoogleCodeExporter commented 8 years ago

Original comment by dnsch...@gmail.com on 7 May 2012 at 5:49

GoogleCodeExporter commented 8 years ago
Mark: I'm passing this to you, since you're working on time-related stuff.

Since splitting time support into a plugin is already a breaking change, this 
might be the ideal time to switch our formatting language to something closer 
to the strftime standard.

Original comment by dnsch...@gmail.com on 6 Jun 2012 at 3:23

GoogleCodeExporter commented 8 years ago
There's a full-featured library that even supports locales at 
http://hacks.bluesmoon.info/strftime/. It's probably overkill to include it 
though. I propose that I will fix up the current date formatting to something 
close to stftime, but only with standard English names/abbreviations. However, 
I'll check for the existence of a strftime property in Date objects, and, if 
found, I'll pass the formatting string to that instead. That way we can 
optionally support more complicated date formatting in different locales but 
still including basic support in a similar format.

Original comment by mrcote on 14 Jun 2012 at 9:06

GoogleCodeExporter commented 8 years ago
This is complete and present in the master branch, as part of Mark Cote's pull 
request #47.

Original comment by dnsch...@gmail.com on 11 Jul 2012 at 1:43