Web icon

Client-Side DateTime Conversion

Stable version 1.0.1 (Compatible with OutSystems 11)
Uploaded on 19 November 2019 by 
 (0 ratings)

Client-Side DateTime Conversion

Converts DateTimes and Times to the browser's local timezone using moment.js.
Read more

Contains 2 web blocks, DateTimeBlock and TimeBlock.  Use these in your Traditional Web screens and pass your DateTime or Time values to them, and they will render to the screen in the browser's local timezone.  Supports AJAX updates of DateTimes and Times as well.

In order to load the necessary supporting code, add a call to InitDateTimeConverter in your Theme's Layout's Preparation.

Important: If your server is not in UTC, adjust the Site Property "ServerTimeZone" in ClientSideDateTimeConverter to the name of the timezone your server is in (e.g. America/New_York, Europe/Lisbon, etc.)

Adjust other Site Properties to change how formatting is done, or if the time zone abbreviation will be shown after the time.  Default is in US date format with 12-hour time.

Uses moment.js and moment.js timezone

Release notes (1.0.1)

Added LocalTimeZoneBlock to show just the user's timezone

Added the ability to override the default DateTime or Time format in DateTimeBlock and TimeBlock

Reviews (0)