It's all about the answers!

Ask a question

Timestamp object does not take value from scirpt


Yavuz Yasin CELIK (51510) | asked Oct 16 '14, 7:28 a.m.
edited Oct 17 '14, 5:31 a.m. by Ralph Schoon (63.1k33645)
dojo.provide("com.halkbank.CurrentDateDefaultValueProvider");

dojo.require("dojo.date"); // We need the date class from Dojo to compare two dates
dojo.require("dojo.date.stamp"); // We need the stamp class to work with ISO date strings

(function() {
    dojo.declare("com.halkbank.CurrentDateDefaultValueProvider", null, {
        getDefaultValue: function(attribute, workItem, configuration) {
            var now = new Date();
            var date = dojo.date.stamp.toISOString(now, {milliseconds:true, zulu:true});
            console.log("Now is: " + date);
            return date;
        }
    });
})();

Timestamp custom atribute does not take default parameter. Scirpt is enabled. RTC version 5.0

Timestamp custom atribute Format(Turkish) : 16 Eki 2014 12:00:00

One answer



permanent link
Ralph Schoon (63.1k33645) | answered Oct 17 '14, 7:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Oct 17 '14, 7:46 a.m.
This code works for me:

/*******************************************************************************
 * Licensed Materials - Property of IBM
 * (c) Copyright IBM Corporation 2011. All Rights Reserved.
 *
 * Note to U.S. Government Users Restricted Rights:  
 * Use, duplication or disclosure restricted by GSA ADP Schedule 
 * Contract with IBM Corp. 
 *******************************************************************************/
dojo.provide("com.example.DefaultValueProvider");
dojo.require("dojo.date"); // We need the date class from Dojo to use dates
dojo.require("dojo.date.stamp"); // We need the stamp class to work with ISO date strings

(function() {
    dojo.declare("com.example.DefaultValueProvider", null, {

        getDefaultValue: function(attribute, workItem, configuration) {
        
    	    var now=new Date();
    	    var nowtimestamp= dojo.date.stamp.toISOString(now, {milliseconds:true, zulu:true});
    	    console.log("Now is: " + nowtimestamp);
			return nowtimestamp;	
        }
    });
})();

Comments
Ralph Schoon commented Oct 17 '14, 7:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

So, which version of RTC, what do the logs say?


Yavuz Yasin CELIK commented Oct 23 '14, 4:44 a.m.

My code also works for our Test Environment. We have a issue for our Development Environment. For Development environment we have a PMR now.


Thanks Ralph. 

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.