You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.4 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. =====================
  5. Date & Time Formatter
  6. =====================
  7. This module was written to extend the functionality of Odoo language engine to
  8. support formatting `Date`, `Time` and `Datetime` fields easily and allow you to
  9. print them in the best format for the user.
  10. Usage
  11. =====
  12. This module adds a technical programming feature, and it should be used by
  13. addon developers, not by end users. This means that you must not expect to see
  14. any changes if you are a user and install this, but if you find you have it
  15. already installed, it's probably because you have another modules that depend
  16. on this one.
  17. If you are a developer, to use this module, you need to:
  18. * Call anywhere in your code::
  19. formatted_string = self.env["res.lang"].datetime_formatter(datetime_value)
  20. * If you use Qweb::
  21. <t t-esc="env['res.lang'].datetime_formatter(datetime_value)"/>
  22. * If you call it from a record that has a `lang` field::
  23. formatted_string = record.lang.datetime_formatter(record.datetime_field)
  24. * Read :meth:`~openerp.addons.datetime_formatter.models.ResLang
  25. .datetime_formatter` docstring to know more about its usage.
  26. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  27. :alt: Try me on Runbot
  28. :target: https://runbot.odoo-community.org/runbot/149/8.0
  29. Bug Tracker
  30. ===========
  31. Bugs are tracked on `GitHub Issues
  32. <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
  33. check there if your issue has already been reported. If you spotted it first,
  34. help us smashing it by providing a detailed and welcomed `feedback
  35. <https://github.com/OCA/
  36. server-tools/issues/new?body=module:%20
  37. datetime_formatter%0Aversion:%20
  38. 8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  39. Credits
  40. =======
  41. Contributors
  42. ------------
  43. * Jairo Llopis <j.llopis@grupoesoc.es>
  44. Maintainer
  45. ----------
  46. .. image:: https://odoo-community.org/logo.png
  47. :alt: Odoo Community Association
  48. :target: https://odoo-community.org
  49. This module is maintained by the OCA.
  50. OCA, or the Odoo Community Association, is a nonprofit organization whose
  51. mission is to support the collaborative development of Odoo features and
  52. promote its widespread use.
  53. To contribute to this module, please visit http://odoo-community.org.