From 1901a8bedd1cb61ddf5db12ec00f355ab591155e Mon Sep 17 00:00:00 2001 From: Dan Toft Date: Tue, 21 Jan 2025 09:37:45 +0100 Subject: [PATCH] Updates getChanges sample The API expects ticks as they would've been provided by C#, JavaScripts default .getTime() only returns Unix Ticks, which the API doesn't like - this might be something a better solution could we written for, such as a ChangeQuery constructor that simply takes in a date object, but for now this will resolve this docs being incorrect --- docs/sp/lists.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sp/lists.md b/docs/sp/lists.md index 4eb0484c7..9d7ea0308 100644 --- a/docs/sp/lists.md +++ b/docs/sp/lists.md @@ -241,7 +241,7 @@ import { IChangeQuery } from "@pnp/sp"; //Resource is the list Id (as Guid) const resource = list.Id; -const changeStart = new Date("2022-02-22").getTime(); +const changeStart = (new Date("2022-02-22").getTime() * 10000) + 621355968000000000); // We need to convert the timestamp to ticks const changeTokenStart = `1;3;${resource};${changeStart};-1`; // build the changeQuery object, here we look at changes regarding Add and Update for Items.