This topic contains 3 replies, has 0 voices, and was last updated by samzad 9 years ago.

  • Author
    Posts
  • #2175 Score: 0

    samzad
    • Contributions: 0
    • Level 1

    Hi Guys

    I have a dilemma, we are a multi subsidiary company with subsidiaries in different countries/jurisdictions. All of which requires specific language and formatting for invoices/credit memos depending on the subsidiary. Currently our global date format is mm/dd/yyyy and it is flowing correctly to the template, we want to show the Transaction and Due date(${record.trandate} +${record.duedate}) in DD-Mon-YYYY (01-Jan-20015) without changing the global date preference. AS per NS support if we change the date preference globally it may effect our existing forms and scripts.

    Is there any Free Marker syntax that can translate the date format for those to fields from mm/dd/yyyy to DD-Mon-YY, any help is appreciated.

    Sam Azad

    Vancouver, Canada
    This is a cached copy. Click here to see the original post.

  • #2176 Score: 0

    cdelacruz
    • Contributions: 0
    • Level 1

    I was able to display the Transaction Date ({trandate}) in your desired format using: ${record.trandate?string(“dd-MMM-yyyy”)}

  • #2177 Score: 0

    samzad
    • Contributions: 0
    • Level 1

    Thanks a lot for the solution Cdelacruz, it worked like a charm. Tried the same syntax for due date ${record.duedate?string(“dd-MMM-yyyy”)} but getting error message when try to save the template, by any chance is “due date” field is not a date field?

  • #2178 Score: 0

    samzad
    • Contributions: 0
    • Level 1

    Figured out how to solve this issue by just adding setting preference

    inside the tag. This transformed the due date to dd-MMM-yyyy format.

You must be logged in to reply to this topic.