[Orca-dev] Alternate date format for rrdtool - works with rrdtool in general and Orca's copy in specific.

Jon Tankersley jon.tankersley at eds.com
Wed Jul 28 22:02:20 PDT 2004


This is an easy patch.....  I've already talked it over with Toby, I just
can't get a clean automake to take it in rrdtool.
This changes the 'Week WW' format to be 'Mon DD'.  This may be easier for
some to follow.  The 'Mon DD' is appropriately centered in the 'week' range.

Index: orca/packages/rrdtool-1.0.46/src/Makefile.in
===================================================================
--- orca/packages/rrdtool-1.0.46/src/Makefile.in        (revision 378)
+++ orca/packages/rrdtool-1.0.46/src/Makefile.in        (working copy)
@@ -65,6 +65,7 @@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
+# add -DALTERNATE_DATE to have rrdtool not use Week WW format.
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 ECHO = @ECHO@
Index: orca/packages/rrdtool-1.0.46/src/rrd_graph.c
===================================================================
--- orca/packages/rrdtool-1.0.46/src/rrd_graph.c        (revision 378)
+++ orca/packages/rrdtool-1.0.46/src/rrd_graph.c        (working copy)
@@ -57,13 +57,23 @@
     {60,       TMT_MINUTE,30, TMT_HOUR,2,    TMT_HOUR,2,
0,"%H:%M"},
     {180,      TMT_HOUR,1,    TMT_HOUR,6,    TMT_HOUR,6,
0,"%H:%M"},
     /*{300,      TMT_HOUR,3,    TMT_HOUR,12,   TMT_HOUR,12,    12*3600,"%a
%p"},  this looks silly*/
+#ifdef ALTERNATE_DATE
+    {600,      TMT_HOUR,6,    TMT_DAY,1,     TMT_DAY,1,     24*3600,"%a
%d"},
+    {1800,     TMT_HOUR,12,   TMT_DAY,1,     TMT_DAY,2,     24*3600,"%a
%d"},
+    {3600,     TMT_DAY,1,     TMT_WEEK,1,    TMT_WEEK,1,  7*24*3600,"%b
%d"},
+    {3*3600,   TMT_WEEK,1,    TMT_MONTH,1,   TMT_WEEK,2,  7*24*3600,"%b
%d"},
+    {6*3600,   TMT_MONTH,1,   TMT_MONTH,1,   TMT_MONTH,1,
30*24*3600,"%m/%y"},
+    {48*3600,  TMT_MONTH,1,   TMT_MONTH,3,   TMT_MONTH,3,
30*24*3600,"%m/%y"},
+    {10*24*3600, TMT_YEAR,1,  TMT_YEAR,1,    TMT_YEAR,1, 365*24*3600,"%y"},
+#else
     {600,      TMT_HOUR,6,    TMT_DAY,1,     TMT_DAY,1,      24*3600,"%a"},
     {1800,     TMT_HOUR,12,   TMT_DAY,1,     TMT_DAY,2,      24*3600,"%a"},
-    {3600,     TMT_DAY,1,     TMT_WEEK,1,     TMT_WEEK,1,
7*24*3600,"Week %V"},
-    {3*3600,   TMT_WEEK,1,      TMT_MONTH,1,     TMT_WEEK,2,
7*24*3600,"Week %V"},
+    {3600,     TMT_DAY,1,     TMT_WEEK,1,    TMT_WEEK,1,  7*24*3600,"Week
%V"},
+    {3*3600,   TMT_WEEK,1,    TMT_MONTH,1,   TMT_WEEK,2,  7*24*3600,"Week
%V"},
     {6*3600,   TMT_MONTH,1,   TMT_MONTH,1,   TMT_MONTH,1, 30*24*3600,"%b"},
     {48*3600,  TMT_MONTH,1,   TMT_MONTH,3,   TMT_MONTH,3, 30*24*3600,"%b"},
     {10*24*3600, TMT_YEAR,1,  TMT_YEAR,1,    TMT_YEAR,1, 365*24*3600,"%y"},
+#endif
     {-1,TMT_MONTH,0,TMT_MONTH,0,TMT_MONTH,0,0,""}
 };

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2404 bytes
Desc: not available
Url : /pipermail/orca-dev/attachments/20040729/a9ceb67e/attachment.bin 


More information about the Orca-dev mailing list