Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ckanext-odsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open-Data
ckanext-odsh
Commits
d25e97b2
Commit
d25e97b2
authored
2 years ago
by
Thorge Petersen
Browse files
Options
Downloads
Patches
Plain Diff
No need to decode as utf8, py3 strings are already decoded
parent
a335a2e0
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!41
Version 2.0.0
,
!38
Merge py3 into dev
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ckanext/odsh/pretty_daterange/date_range_formatter.py
+2
-7
2 additions, 7 deletions
ckanext/odsh/pretty_daterange/date_range_formatter.py
with
2 additions
and
7 deletions
ckanext/odsh/pretty_daterange/date_range_formatter.py
+
2
−
7
View file @
d25e97b2
...
@@ -73,23 +73,18 @@ class DateRangeFormatter(object):
...
@@ -73,23 +73,18 @@ class DateRangeFormatter(object):
def
_construct_single_date_string
(
self
,
date
,
format
):
def
_construct_single_date_string
(
self
,
date
,
format
):
return
format_date
(
date
,
format
=
format
,
locale
=
self
.
locale_for_date_strings
)
return
format_date
(
date
,
format
=
format
,
locale
=
self
.
locale_for_date_strings
)
@staticmethod
def
_as_utf_8
(
s
):
return
''
+
s
.
decode
(
'
utf-8
'
)
def
_construct_half_of_year_date_string
(
self
):
def
_construct_half_of_year_date_string
(
self
):
year
=
self
.
date_start
.
year
year
=
self
.
date_start
.
year
half
=
self
.
_date_range
.
get_half_year
(
self
.
date_start
)
half
=
self
.
_date_range
.
get_half_year
(
self
.
date_start
)
half_of_year_date_string
=
'
{}. Halbjahr {}
'
.
format
(
half
,
year
)
half_of_year_date_string
=
'
{}. Halbjahr {}
'
.
format
(
half
,
year
)
return
DateRangeFormatter
.
_as_utf_8
(
half_of_year_date_string
)
return
half_of_year_date_string
def
_construct_quarter_of_year_date_string
(
self
):
def
_construct_quarter_of_year_date_string
(
self
):
year
=
self
.
date_start
.
year
year
=
self
.
date_start
.
year
quarter
=
self
.
_date_range
.
get_quarter
(
self
.
date_start
)
quarter
=
self
.
_date_range
.
get_quarter
(
self
.
date_start
)
quarter_of_year_date_string
=
'
{}. Quartal {}
'
.
format
(
quarter
,
year
)
quarter_of_year_date_string
=
'
{}. Quartal {}
'
.
format
(
quarter
,
year
)
return
DateRangeFormatter
.
_as_utf_8
(
quarter_of_year_date_string
)
return
quarter_of_year_date_string
def
_construct_date_range_string
(
self
,
format_date_start
,
format_date_end
):
def
_construct_date_range_string
(
self
,
format_date_start
,
format_date_end
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment