The community members are discussing how to convert a date string, $ws$dataSource$R0KbIHO_uPJv9pQNHA5j0["published_at"], to display the time elapsed since the publication (e.g., "6 min ago"). The suggested options are:
1. Perform the conversion on the backend if it supports it.
2. Use the date variable in an HTML embed and employ JavaScript to calculate the time elapsed.
The community members provide some guidance on using the Intl.RelativeTimeFormat API in JavaScript, but the OP struggles with the code implementation. They suggest using ChatGPT to help with the task, as they find the JavaScript code challenging.
There is no explicitly marked answer in the comments, but the community members provide suggestions and guidance to help the OP achieve the desired functionality.
bind the text content with whatever comes from your data
Add a reply
Sign up and join the conversation on Discord
","dateCreated":"2024-11-11T17:05:46.105Z","dateModified":"2024-11-11T17:05:46.105Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/cdd3ed87-53a0-414a-885a-56b7939e412a","name":"Oleg Isonen","identifier":"cdd3ed87-53a0-414a-885a-56b7939e412a","image":"https://cdn.discordapp.com/avatars/469405813048606720/8b66a5882214c63ee6148fcce3ef8e93.webp?size=256"},"commentCount":0,"comment":[],"position":6,"upvoteCount":0},{"@type":"Comment","text":"something like this","dateCreated":"2024-11-11T17:06:09.556Z","dateModified":"2024-11-11T17:06:09.556Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/cdd3ed87-53a0-414a-885a-56b7939e412a","name":"Oleg Isonen","identifier":"cdd3ed87-53a0-414a-885a-56b7939e412a","image":"https://cdn.discordapp.com/avatars/469405813048606720/8b66a5882214c63ee6148fcce3ef8e93.webp?size=256"},"commentCount":0,"comment":[],"position":7,"upvoteCount":0},{"@type":"Comment","text":"just to give you a direction","dateCreated":"2024-11-11T17:06:13.394Z","dateModified":"2024-11-11T17:06:13.394Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/cdd3ed87-53a0-414a-885a-56b7939e412a","name":"Oleg Isonen","identifier":"cdd3ed87-53a0-414a-885a-56b7939e412a","image":"https://cdn.discordapp.com/avatars/469405813048606720/8b66a5882214c63ee6148fcce3ef8e93.webp?size=256"},"commentCount":0,"comment":[],"position":8,"upvoteCount":0},{"@type":"Comment","text":"ok, way beyond my skills, I get lost with code but I will try, thanks","dateCreated":"2024-11-11T17:06:46.654Z","dateModified":"2024-11-11T17:06:46.654Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/44148e9d-e525-423d-a321-1bcc55f73e70","name":"mywebmasteruk","identifier":"44148e9d-e525-423d-a321-1bcc55f73e70","image":"https://cdn.discordapp.com/avatars/1124723990523564092/10653975ad183b8c15be1e1ce5e2a4c2.webp?size=256"},"commentCount":0,"comment":[],"position":9,"upvoteCount":0},{"@type":"Comment","text":"gpt can prob do it","dateCreated":"2024-11-11T17:07:08.598Z","dateModified":"2024-11-11T17:07:08.598Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/cdd3ed87-53a0-414a-885a-56b7939e412a","name":"Oleg Isonen","identifier":"cdd3ed87-53a0-414a-885a-56b7939e412a","image":"https://cdn.discordapp.com/avatars/469405813048606720/8b66a5882214c63ee6148fcce3ef8e93.webp?size=256"},"commentCount":0,"comment":[],"position":10,"upvoteCount":0},{"@type":"Comment","text":"Check with ChatGPT. here is the general model","dateCreated":"2024-11-11T17:07:17.518Z","dateModified":"2024-11-11T17:07:17.518Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/a3a85f00-1132-4262-8176-1ff92ab9d883","name":"John Siciliano","identifier":"a3a85f00-1132-4262-8176-1ff92ab9d883","image":"https://cdn.discordapp.com/avatars/1141467296532009071/8c83067a661d2916bfb8be5a37677463.webp?size=256"},"commentCount":0,"comment":[],"position":11,"upvoteCount":0},{"@type":"Comment","text":"idea is you use your variable in an html embed, modify it using some custom logic, then output it to some instance on your page","dateCreated":"2024-11-11T17:07:50.309Z","dateModified":"2024-11-11T17:07:50.309Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/a3a85f00-1132-4262-8176-1ff92ab9d883","name":"John Siciliano","identifier":"a3a85f00-1132-4262-8176-1ff92ab9d883","image":"https://cdn.discordapp.com/avatars/1141467296532009071/8c83067a661d2916bfb8be5a37677463.webp?size=256"},"commentCount":0,"comment":[],"position":12,"upvoteCount":0},{"@type":"Comment","text":"got you, thanks guys","dateCreated":"2024-11-11T17:08:17.250Z","dateModified":"2024-11-11T17:08:17.250Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/44148e9d-e525-423d-a321-1bcc55f73e70","name":"mywebmasteruk","identifier":"44148e9d-e525-423d-a321-1bcc55f73e70","image":"https://cdn.discordapp.com/avatars/1124723990523564092/10653975ad183b8c15be1e1ce5e2a4c2.webp?size=256"},"commentCount":0,"comment":[],"position":13,"upvoteCount":0},{"@type":"Comment","text":"world be great to have chatGPT inside the expression editor! I can just tell it what to do and it would create the javascript code","dateCreated":"2024-11-13T03:11:40.627Z","dateModified":"2024-11-13T03:11:40.627Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/44148e9d-e525-423d-a321-1bcc55f73e70","name":"mywebmasteruk","identifier":"44148e9d-e525-423d-a321-1bcc55f73e70","image":"https://cdn.discordapp.com/avatars/1124723990523564092/10653975ad183b8c15be1e1ce5e2a4c2.webp?size=256"},"commentCount":0,"comment":[],"position":14,"upvoteCount":0},{"@type":"Comment","text":"I cant seem to achieve this, could someone do a video please, I am useless at javascript, I dont even know what t o ask chatGPT","dateCreated":"2024-11-13T04:47:25.458Z","dateModified":"2024-11-13T04:47:25.458Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/44148e9d-e525-423d-a321-1bcc55f73e70","name":"mywebmasteruk","identifier":"44148e9d-e525-423d-a321-1bcc55f73e70","image":"https://cdn.discordapp.com/avatars/1124723990523564092/10653975ad183b8c15be1e1ce5e2a4c2.webp?size=256"},"commentCount":0,"comment":[],"position":15,"upvoteCount":0},{"@type":"Comment","text":"ask it exactly what yo need to do from user perspective then tell it to take the date string from text content and replace it with a formatted date","dateCreated":"2024-11-13T10:37:59.768Z","dateModified":"2024-11-13T10:37:59.768Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/cdd3ed87-53a0-414a-885a-56b7939e412a","name":"Oleg Isonen","identifier":"cdd3ed87-53a0-414a-885a-56b7939e412a","image":"https://cdn.discordapp.com/avatars/469405813048606720/8b66a5882214c63ee6148fcce3ef8e93.webp?size=256"},"commentCount":0,"comment":[],"position":16,"upvoteCount":0},{"@type":"Comment","text":"bind the text content with whatever comes from your data","dateCreated":"2024-11-13T10:38:23.483Z","dateModified":"2024-11-13T10:38:23.483Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/cdd3ed87-53a0-414a-885a-56b7939e412a","name":"Oleg Isonen","identifier":"cdd3ed87-53a0-414a-885a-56b7939e412a","image":"https://cdn.discordapp.com/avatars/469405813048606720/8b66a5882214c63ee6148fcce3ef8e93.webp?size=256"},"commentCount":0,"comment":[],"position":17,"upvoteCount":0}],"author":{"@type":"Person","url":"https://help.webstudio.is/members/44148e9d-e525-423d-a321-1bcc55f73e70","name":"mywebmasteruk","identifier":"44148e9d-e525-423d-a321-1bcc55f73e70","image":"https://cdn.discordapp.com/avatars/1124723990523564092/10653975ad183b8c15be1e1ce5e2a4c2.webp?size=256"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0}}]