Difference between revisions of "User expirePoints"
(→Return type) |
(→Example) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
= User_expirePoints = | = User_expirePoints = | ||
+ | Expire all points of given users before the given time | ||
== Syntax == | == Syntax == | ||
− | User_expirePoints(array userResourceId, | + | User_expirePoints(array userResourceId, DateTime expireAllBefore, string Description[, Boolean Test]); |
== Arguments == | == Arguments == | ||
Line 11: | Line 12: | ||
* expireAllBefore: DateTime class, points will be expired before that time | * expireAllBefore: DateTime class, points will be expired before that time | ||
* Description: string | * Description: string | ||
− | * Test: Boolean, optional. If false all points before input time will be expired; if True will return amount expired but doesnt actually expire | + | * Test: Boolean, optional default not set is true. If false all points before input time will be expired; if True will return amount expired but doesnt actually expire |
== Return type == | == Return type == | ||
Line 19: | Line 20: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
+ | //Expire all points before 2019 of 2 given users | ||
+ | //To see how many points will be expired, don't give Test parameter, or set Test = True | ||
+ | DateTime a = new DateTime("2019/1/1"); | ||
+ | User_expirePoints({13848,15498936}, a , "Expire all point before 2019", true); | ||
+ | //{"13848": 50, "15498936": 0} | ||
− | + | //To make actually expire, set Test to false | |
− | + | DateTime a = new DateTime("2019/1/1"); | |
+ | User_expirePoints({13848,15498936}, a , "Expire all point before 2019", false); | ||
+ | //{"13848": 50, "15498936": 0} | ||
</source> | </source> | ||
+ | [[File:2019-11-22_17-17-34.png|1200px]] |
Latest revision as of 11:22, 22 November 2019
User_expirePoints
Expire all points of given users before the given time
Syntax
User_expirePoints(array userResourceId, DateTime expireAllBefore, string Description[, Boolean Test]);
Arguments
- userResourceId: array of userResourceId
- expireAllBefore: DateTime class, points will be expired before that time
- Description: string
- Test: Boolean, optional default not set is true. If false all points before input time will be expired; if True will return amount expired but doesnt actually expire
Return type
Dictionary (Dictionary of userResourceId, Amount expired)
Example
//Expire all points before 2019 of 2 given users
//To see how many points will be expired, don't give Test parameter, or set Test = True
DateTime a = new DateTime("2019/1/1");
User_expirePoints({13848,15498936}, a , "Expire all point before 2019", true);
//{"13848": 50, "15498936": 0}
//To make actually expire, set Test to false
DateTime a = new DateTime("2019/1/1");
User_expirePoints({13848,15498936}, a , "Expire all point before 2019", false);
//{"13848": 50, "15498936": 0}