During creation of leader boards we can use expressions like ${today} ${format(today,...)}.
Is it possible to use those same expressions in cloud code, for example in order to display leader board for specific week i.e. leaderboardShortcode: SomeLeaderboard.week.${format(today, 'yyyyww')}?
Since there are more expressions than those mentioned in GS Documantation, can you post update of all available expressions we can use in cloud code or in events definitions?
Best Regards,
Sasha
Best Answer
C
Customer Support
said
over 4 years ago
Hi Sasha,
I'm afraid you can't use those expressions in Cloud code. You would have to use a combination of JavaScripts date methods or a custom method of your own to generate the fields required for retrieving a specific leaderboard by shortCode. As for the full list of expressions available, I'll raise this with our documentation team and get the list updated if there are more to be added.
I'm afraid you can't use those expressions in Cloud code. You would have to use a combination of JavaScripts date methods or a custom method of your own to generate the fields required for retrieving a specific leaderboard by shortCode. As for the full list of expressions available, I'll raise this with our documentation team and get the list updated if there are more to be added.
Thanks,
Liam
k
kamau vassall
said
about 4 years ago
It's funny that he's asking about ${format(today, 'yyyyww')}. I feel like ${format(today, 'yyyyww')} doesn't seem to be following ISO 8601
SashaMirkovic
Hello,
During creation of leader boards we can use expressions like ${today} ${format(today,...)}.
Is it possible to use those same expressions in cloud code, for example in order to display leader board for specific week i.e. leaderboardShortcode: SomeLeaderboard.week.${format(today, 'yyyyww')}?
Since there are more expressions than those mentioned in GS Documantation, can you post update of all available expressions we can use in cloud code or in events definitions?
Best Regards,
Sasha
Hi Sasha,
I'm afraid you can't use those expressions in Cloud code. You would have to use a combination of JavaScripts date methods or a custom method of your own to generate the fields required for retrieving a specific leaderboard by shortCode. As for the full list of expressions available, I'll raise this with our documentation team and get the list updated if there are more to be added.
Thanks,
Liam
1 person has this question
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Sasha,
I'm afraid you can't use those expressions in Cloud code. You would have to use a combination of JavaScripts date methods or a custom method of your own to generate the fields required for retrieving a specific leaderboard by shortCode. As for the full list of expressions available, I'll raise this with our documentation team and get the list updated if there are more to be added.
Thanks,
Liam
kamau vassall
It's funny that he's asking about ${format(today, 'yyyyww')}. I feel like ${format(today, 'yyyyww')} doesn't seem to be following ISO 8601
https://en.wikipedia.org/wiki/ISO_8601
Currently I cannot get the same shortcode as the server using the servers own time
In Layman's terms, right now (12/19/2016) when I create a new event in TestHarness its created with week 52 instead of week 51.
List of expressions I've found:
${today} - The epoch time of midnight today.
${now} - The current epoch time.
${today:minusDays(N)} - The epoch time of midnight N days ago.
${today:plusDays(N)} - The epoch time of midnight N days in the future.
${today:startOfWeek()} - The epoch time of midnight at the start of the week.
${today:startOfMonth()} - The epoch time of midnight at the start of the month.
${format(today, 'yyyyMMdd')} - The epoch time of midnight today formatted for [year][month][day] (Good for partitioning days)
${format(today, 'yyyyww')} - Doesn't seem to be following ISO_8601 (supposed to be for partitioning weeks)
${format(today, 'yyyyMM')} - The epoch time of midnight today formatted for [year][month] (Good for partitioning months)
kamau vassall
I would suggest switching ${format(today, 'yyyyww')} to ${format(today, 'yyyyMMWW')}
This uses the week inside the month. so today it would output '20161204'
In this manner I was able to get everything matching though I'm not sure if this will have issues in the future.
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2486 topics