XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently 2017年 Nov 17日 09:23

All times are UTC - 8 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Display +/- hour with jv
PostPosted: 2017年 Jul 12日 07:39 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4555
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 21 times
test.png
test.png [ 49.27 KiB | Viewed 250 times ]

_________________
Image
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
PostPosted: 2017年 Jul 12日 10:27 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4555
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.. :?

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


Top
 Profile  
 
PostPosted: 2017年 Jul 12日 10:48 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 570
There you go Jim.


Attachments:
testhours.xwp [6.28 KiB]
Downloaded 23 times
Top
 Profile  
 
PostPosted: 2017年 Jul 12日 12:14 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4555
Thanks Dean..! Let me try it :)

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


Top
 Profile  
 
PostPosted: 2017年 Jul 12日 12:54 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 570
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: 2017年 Jul 12日 15:01 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4555
Thanks again Dean. Check my reply on DA..

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


Top
 Profile  
 
PostPosted: 2017年 Jul 19日 07:44 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 570
How did you get on Jim?


Top
 Profile  
 
PostPosted: 2017年 Jul 19日 13:30 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4555
All ok Dean! Thanks again for your help.
I used your script here:

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

_________________
Image
...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 8 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:  

Powered by phpBB® Forum Software © phpBB Group