Odoo Help

0

What are options to format date in the POS receipt?

By
Pascal Tremblay
on 3/18/15, 10:29 AM 1,687 views

Hello everybody,

I would want to know possibilities to format date at the top of the POS receipt.

My goal : I want the date like this « 3 janvier 2015 ».

Actually, in the file /home/odoo-test/odoo-test/addons/point_of_sale/static/src/xml/pos.xml :


      <t t-name="PosTicket">

              <div class="pos-sale-ticket" style="font-family: 'Ubuntu';">

                  <div class="pos-center-align">

                      <t t-esc="new Date().toString(Date.CultureInfo.formatPatterns.shortDate + ' ' +

                          Date.CultureInfo.formatPatterns.longTime)"/><br />

                      <t t-esc="order.get('name')"/>

                  </div>


Thanks

1

Hello

This should do the trick.

But you break the language format... (Take a look here for more format : https://code.google.com/p/datejs/wiki/FormatSpecifiers)

<t t-esc="new Date().toString('d MMMM yyyy')"/>

It works! Thanks a lot!!!!!

Pascal Tremblay
on 3/21/15, 5:10 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 3/18/15, 10:29 AM
Seen: 1687 times
Last updated: 6/21/16, 7:12 AM