Input Widget Date Format Incorrect
Question
Application Type
Reactive
Service Studio Version
11.11.9 (Build 46344)

I want to display the date as YYYY-MM-DD HH:mm:ss but the display is 

2021-07-22T14:19

Problem: There is a T between Date and Time.  The Seconds is missing.


The original Input widget shows the Time in 12 Hours, having AM and PM which I do not want, I want 24Hrs. Therefore, I added a date Picker to change the format of the date


The data binding for the updatedOn is as follows

The entity Students2 has an attribute of updatedOn. The dataType is set as DateTime, No Default Value.


The incorrect DateTime display is follows


Would anyone kindly suggest/direct me to the solve the date parsing issue?




Solution

after 2 Days of struggling the solutions are as follows

Environment: Reactive Apps Environment 

  1. On the UI Flow Create an event OnReady
  2. OnReady Assign Variable updatedOn as Text
  3. FormatDateTime(GetStudentById.List.Current.Student2.updatedOn,"yyyy-MM-dd HH:mm:ss")

Figure 1 UI Flow in OnReady Client Action

Figure 2 Rendered Date in HTML

mvp_badge
MVP

Hi Calvin,

Here I can see date format like no sapce between DD and HH

It should be like - "YYYY-MM-DD HH:mm:ss" instead of "YYYY-MM-DDHH:mm:ss"  

It does not work with the format

YYYY-MM-DD HH:mm:ss


Rendered HTML


How is  your Date retrieved?

The Date as shown in Figure 1 is retrieved from database which has error.

i.e. 

GetStudentById.List.Current.Student2.updatedOn



The data Defined in a local variable with a dynamic value, CurrDateTime() formats the date correctly.

let t=CurrDateTime()

Variable=t

(Settings in the Date Picker Widget)



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.