Yes, I guess rather than setting dt to the current time, you would need to read the updated_time or user_updated_time attribute of the note, if they exist in the model.

You say the code you posted runs on Android but not on desktop. Does it mean we can run javascript in notes on Android? I wonder why there is a difference between Android and desktop.