Request help writing script code

.

Is it possible to have a JavaScript code that shows me the date on the label when opening an application without the Internet and it changes automatically?

yes, possible

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <script>
        function sendDateTime() {
            var now = new Date();
            var dateTimeString = now.toLocaleString(); // Get formatted date and time
            window.AppInventor.setWebViewString(dateTimeString); // Send to Kodular
        }
        setInterval(sendDateTime, 1000); // Update every second
    </script>
</head>
<body onload="sendDateTime()">
</body>
</html>

2 Likes

Why not just using the Clock component?
Taifun

I forgot because I left a while and found code from artificial intelligence thanks to all

Didnt the above one help you? What is the script you used in your app?

no Didnt the above one help

Oh, well then if you dont mind share your code here and it may helpful to others in future

“Okay, I have code for converting Hijri dates to Gregorian dates and vice versa that works offline. Should I share the code here, or has someone already done this before?”

Yes, please start a new thread in category Guides and publish it there

Taifun

1 Like

Thats fine. But your query was to provide js code to get date and change every second so we provide the above and now you have mentioned you got the code to convert hiji to Gregorian… Make sure with your query buddy

(Apology: I got a bit confused with some topics and answered a previously solved issue. My actual request for help is: I have a button on the screen, and I want to add text inside a CardView such that a text input box appears to enter specific text, send it to the CardView, keep the text saved in the CardView, and allow adding unlimited new texts. That’s my request. I apologize for the confusion in the topics.

When the button is clicked,
Set the label text to join lable text + textbox text.

Is there a project in the community that was published here!!! If you understand my idea. When you press the button at any time, a field appears in which the text is inserted and the text goes automatically to Card View. Not just one text, but more than one text is inserted In the input box

the text should go into the same lable or everytime while click button thet text box text should go to different lable. eg., types and enter creates a label inside the card. again type and enter creates lale insde the same card view or different card view. pls more specific

1 Like