Hi All,
I've been playing around with the code task in an action as I'd like to format the ticket metadata Field/updatedAt date and time to a more friendly time and provide this in an email.
For example: ${tck://Field/updatedAt} will return 2021-04-01T09:07:02.362Z
Using the below code I can get half way there. I need to sort out the date so that it's a British format and also the time so that it takes into account the daylight saving time. When you take a look at the time in the follow-up screen in Qualtrics you can see that it's an hour out.
function codeTask() {
var d = new Date('${tck://Field/updatedAt}');
var n = d.toLocaleDateString() + ' ' + d.toLocaleTimeString();
return {
result : n
}
}
Using the above example, this returns '2021-4-01 09:07:02'.
These are my settings in my account:
How in code do I offset the time by the appropriate daylight saving time and how do I tell JavaScript I wish to see the British Date format?
Hope you can help
Thanks
Rod Pestell
CodeTask adjust Ticket updatedAt time to reflect Daylight Saving Time
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
