Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Timestamp object does not take value from scirpt

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

0 votes



One answer

Permanent link
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;	
        }
    });
})();

0 votes

Comments

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

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 152

Question asked: Oct 16 '14, 7:28 a.m.

Question was seen: 4,618 times

Last updated: Oct 23 '14, 4:44 a.m.

Confirmation Cancel Confirm