NodeJS -> B4X [JOB COMPLETED!]

ilan

Expert
Licensed User
Longtime User
hi

i would like to convert this NodeJS library to B4x:


this is the app.js i run using NodeJS and i am getting what i want:

B4X:
const KosherZmanim = require("kosher-zmanim");

var date = new Date();

    const options = {
        date: date.toISOString().substr(0, 19),
        timeZoneId: "Asia/Jerusalem",
        locationName: "Haifa",
        latitude: Number.parseFloat("32.817280"),
        longitude: Number.parseFloat("34.988762"),
        elevation: Number.parseFloat("0"),
        complexZmanim: true,
    };
                  
    const json = KosherZmanim.getZmanimJson(options);
    
    console.log(JSON.stringify(json, null, 2));

returned Json String:


now i would like to use it in b4x without running a server. i would like to convert the whole library so i can run the function inside b4x OFFLINE.

how much would you charge for it? you can send me pm.

thanx, ilan


EDIT: online live example: https://behindthemath.github.io/KosherZmanim/

EDIT: job is currently given to @tummosoft . If there will be any changes i will update the thread. Thanks ??
 
Last edited:

ilan

Expert
Licensed User
Longtime User
oh sorry @DonManfred you asked for the DateString i read data string.

the date looks like this:

"2024-04-01"

YYYY-MM-DD

it can also include time but this is not important. but the dateformat is important.
 

ilan

Expert
Licensed User
Longtime User
But the code is expecting a 19 bytes long String!?

in the example code above i entered a date including time like this:

2024-04-24T13:14:55

but entering the date alone is good enough as long as it is like this: YYYY-MM-DD (month and day needs to be 2 DIGITS!!)

What is the "output" of this code?

2024-04-24T13:14:55

you can try it here:

B4X:
<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>
<p>Create a new date object with the current date and time:</p>

<p id="demo"></p>

<script>
var date = new Date();
document.getElementById("demo").innerHTML = date.toISOString().substr(0, 19);
</script>

</body>
</html>

enter the code above here:

 

ilan

Expert
Licensed User
Longtime User
Ok thanks @DonManfred. Actually 2 members offer their service i will start with @tummosoft and give him the opportunity to do the job.
If there will be any changes i will update the thread thank you all ??
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…