[modules/date] Combine to datetime module with date and time aliases

Move module "date" to "datetime" (display both date and time), and
create new aliases "time" and "date" (which only show date and time,
respectively).
This commit is contained in:
Tobias Witek 2016-10-31 14:39:52 +01:00
parent b0608c7054
commit b3e17d4899
3 changed files with 9 additions and 2 deletions

View file

@ -1 +1 @@
time.py
datetime.py

View file

@ -0,0 +1 @@
time.py

View file

@ -1,3 +1,5 @@
from __future__ import absolute_import
import datetime
import bumblebee.module
@ -6,8 +8,12 @@ class Module(bumblebee.module.Module):
super(Module, self).__init__(args)
module = self.__module__.split(".")[-1]
default = "%x %X"
if module == "date":
default = "%x"
if module == "time":
default = "%X"
default = "%x" if module == "date" else "%X"
self._fmt = args[0] if args else default