0
votes

strange effect for me: a computed text with @created() gives me crazy results:

e.g. creation datetime is: 09.02.2015 21:27 the xpage shows: 07.07.2014 20:47

it is depending of the opened doc (it's not the creation date of the design element), but it does sth I do not understand.

Am I using it incorrectly?

thx, Uwe

the code goes like:

                                    <xp:text escape="true"
                                        id="compCreated">
                                        <xp:this.converter>
                                            <xp:convertDateTime
                                                type="both" timeStyle="short">
                                            </xp:convertDateTime>
                                        </xp:this.converter>
                                        <xp:this.value><![CDATA[#{javascript:@Created()}]]></xp:this.value>
                                    </xp:text>
5
Do you define more document data sources? In this form @Created() returns data for last defined data source (as many other functions without explicit data source reference).Frantisek Kossuth

5 Answers

2
votes

@Created() returns data for last defined data source (as many other functions without explicit data source reference).

Moved from comment so you can accept my answer ;-)

1
votes

Frantisek Kossuth solves it (as a comment, so I answer it here): I have multiple data sources defined, and it shows the creation date of the other data source. Thank you Frantisek

0
votes

@Created returns a Date JavaScript object. You may want to handle the conversion of that to a string yourself to avoid variations based on your server's locale.

Howard

0
votes

try this, if your data source is named "d"

d.getDocument().getCreated().toJavaDate()
0
votes

Try using the timezone property and set it to your timezone properly. Date fields (the converters) sometimes behave weird when running on different environments that are also mixed with local browser/machine settings. I documented it here: http://oliverbusse.notesx.net/hp.nsf/blogpost.xsp?documentId=D22