Coverage for /home/runner/work/viur-core/viur-core/viur/src/viur/core/render/html/env/date.py: 0%

16 statements  

« prev     ^ index     » next       coverage.py v7.6.3, created at 2024-10-16 22:16 +0000

1import typing as t 

2 

3from datetime import date as date_orig, datetime as datetime_orig, time as time_orig, timedelta as timedelta_orig 

4 

5from ..utils import jinjaGlobalFunction 

6from ..default import Render 

7 

8 

9@jinjaGlobalFunction 

10def dateTime(render: Render) -> t.Type[datetime_orig]: 

11 """ 

12 Jinja2 global: Returns the datetime class 

13 

14 :return: datetime class 

15 """ 

16 return datetime_orig 

17 

18 

19@jinjaGlobalFunction 

20def date(render: Render) -> t.Type[date_orig]: 

21 """ 

22 Jinja2 global: Returns the date class 

23 

24 :return: date class 

25 """ 

26 return date_orig 

27 

28 

29@jinjaGlobalFunction 

30def time(render: Render) -> t.Type[time_orig]: 

31 """ 

32 Jinja2 global: Returns the time class 

33 

34 :return: time class 

35 """ 

36 return time_orig 

37 

38 

39@jinjaGlobalFunction 

40def timedelta(render: Render) -> t.Type[timedelta_orig]: 

41 """ 

42 Jinja2 global: Returns the timedelta class 

43 

44 :return: timedelta class 

45 """ 

46 return timedelta_orig