vergoh / vnstat

vnStat - a network traffic monitor for Linux and BSD
GNU General Public License v2.0
1.38k stars 120 forks source link

Suggestion: Give us option to change format from [Jul '17] to something else, like [6/10/2017-7/9/2017] #72

Open hub2git opened 6 years ago

hub2git commented 6 years ago

Dear dev,

My vnstat report looks like this:

root@LEDE:~# vnstat 

                      rx      /      tx      /     total    /   estimated
 wlan1:
       Jul '17     57.83 MiB  /  497.46 MiB  /  555.29 MiB
       Aug '17     50.55 MiB  /  369.29 MiB  /  419.84 MiB  /  540.00 MiB
     yesterday         0 KiB  /    2.49 MiB  /    2.49 MiB
         today         0 KiB  /      44 KiB  /      44 KiB  /      --    

 wlan0:
       Jul '17    186.26 MiB  /    1.31 GiB  /    1.49 GiB
       Aug '17    536.69 MiB  /    3.82 GiB  /    4.34 GiB  /    5.60 GiB
     yesterday     39.56 MiB  /  290.88 MiB  /  330.45 MiB
         today      1.94 MiB  /    3.10 MiB  /    5.03 MiB  /     197 MiB

I sometimes find myself looking at the monthly report and seeing something like Jul '17and wondering, Hmmm... is that A) the July 10 to August 9 cycle or B) the June 10 to July 9 cycle?

Might I suggest giving us the option of renaming them? Some possible formats: (Words) July 10, 2017 -- Aug. 9, 2017 or (Pure numbers) 06/10 - 07/09/2017.

vergoh commented 6 years ago

You could achieve something close to that by kind of cheating a little bit. It's possible to modify MonthFormat in the configuration file to contain hardcoded characters like the "10" in your case. However, getting the end of the cycle would be a little bit trickier as even the database doesn't really have that information available.

tolysz commented 6 years ago

On that note could we have an option to show dates in "ISO 8601" format?

vergoh commented 6 years ago

The ISO 8601 format is the default starting from b6aaf0bbc1eb16d15691993bce6c8593bde961e0.