Date & Time Formatter
datetime_formatter · OCA/server-tools
Health
61/100
fair
-
Security25/25No findings
-
Activity6/25Last human commit 31 months ago
-
Required by5/250 modules depend on it
-
Maturity25/25In 9 Odoo series since 8.0
Heuristic over the facts below, not an audit · How it's computed
Required by
0
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.05 MB
Module directory on disk
Code analysis
0 migration notes
1 model
0 views
0 HTTP endpoints
Description
Dependencies
- Odoo dependencies
-
odoo/odoo:- base
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 0
No views found for this module.
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 1
New fields (0)
No new fields.
Public methods (2)-
best_match(self, lang=None, failure_safe=True)@api.modelGet best match of current default lang. :param str lang: If a language in the form of "en_US" is supplied, it will have the highest priority. :param bool failure_safe: If ``False`` and the best matched language is not found installed, an exception will be raised. Otherwise, the first installed language found in the DB will be returned. -
datetime_formatter(self, value, lang=None, template=MODE_DATETIME, separator=' ', failure_safe=True)@api.modelConvert a datetime field to lang's default format. :type value: `str`, `float` or `datetime.datetime` :param value: Datetime that will be formatted to the user's preferred format. :param str lang: See :param:`lang` from :meth:`~.best_match`. :param bool failure_safe: See :param:`failure_safe` from :meth:`~.best_match`. :param str template: Will be used to format :param:`value`. If it is one of the special constants :const:`MODE_DATETIME`, :const:`MODE_DATE` or :const:`MODE_TIME`, it will use the :param:`lang`'s default template for that mode. :param str separator: Only used when :param:`template` is :const:`MODE_DATETIME`, as the separator between the date and time parts.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…