XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 1st, 2025, 11:42 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Display +/- hour with jv
PostPosted: July 12th, 2017, 7:39 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I have 3 txts and I would like to visualize the current hour (middle txt), hour -1 for the left txt and hour +1 for the right one.
Something like this screenshot, where the 10 is the current hour, the left is hour-1=9 and the right hour+1=11

How can I reproduce it with java script...?
I attach a simple demo widget


Attachments:
testhours.xwp [5.97 KiB]
Downloaded 751 times
test.png
test.png [ 49.27 KiB | Viewed 15400 times ]

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
PostPosted: July 12th, 2017, 10:27 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Code:
var hr;

// function to update the time

function updateTime() {
//initialise the time function
var time = new Date();

//returns the date/time in a string format
hr = time.getHours();
hr = hr + 1;
}


in main.xul

<cores>
<dateTimeCore name="clockTimer" onUpdate="updateTime"/>
</cores>

yereverluvinuncleber, I added your script but I need to assign the texts.. :?

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 12th, 2017, 10:48 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
There you go Jim.


Attachments:
testhours.xwp [6.28 KiB]
Downloaded 720 times
Top
 Profile  
 
PostPosted: July 12th, 2017, 12:14 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Thanks Dean..! Let me try it :)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 12th, 2017, 12:54 pm 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
You'll have to add the minus side yourself but it'll be easy enough to do so. You have a serious need for some javascript skills. As I suggested in my DA note to you, I'm willing to give you a little tuition.


Top
 Profile  
 
PostPosted: July 12th, 2017, 3:01 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Thanks again Dean. Check my reply on DA..

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: July 19th, 2017, 7:44 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
How did you get on Jim?


Top
 Profile  
 
PostPosted: July 19th, 2017, 1:30 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
All ok Dean! Thanks again for your help.
I used your script here:

http://jimking.deviantart.com/art/Son-O ... -692249411

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Powered by phpBB® Forum Software © phpBB Group