webOS Nation Forums >  Homebrew >  webOS patches > Add date to time at top
Add date to time at top

  Reply
 
LinkBack Thread Tools Display Modes
Old 08/25/2009, 09:25 PM   #1 (permalink)
Member
 
Join Date: Nov 2003
Posts: 334
Likes Received: 0
Thanks: 20
Thanked 22 Times in 9 Posts
Default Add date to time at top

I couldn't find this in the forums, so I figured it out myself. Apologies if I failed at searching

In

Code:
/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
Search for

Code:
$('clock').innerHTML = Mojo.Format.formatDate(date, {time:format});
And replace with

Code:
$('clock').innerHTML = Mojo.Format.formatDate(date, {date:'short',time:format});
This will change your time on the top bar to the format

8/25/09 10:24
dirtygreek is offline   Reply With Quote
Old 08/25/2009, 10:22 PM   #2 (permalink)
Member
 
Join Date: Jun 2009
Posts: 244
Likes Received: 0
Thanks: 11
Thanked 8 Times in 8 Posts
Default

Oh cool, I would have to wait to try it though
chefjabril11 is offline   Reply With Quote
Old 08/25/2009, 11:01 PM   #3 (permalink)
Media Developer
 
UndeadCircus's Avatar
 
Join Date: Jul 2009
Location: Elm Street
Posts: 338
Likes Received: 0
Thanks: 47
Thanked 130 Times in 73 Posts
Default

Very nice! Thanks for a really solid contribution!
UndeadCircus is offline   Reply With Quote
Old 08/25/2009, 11:23 PM   #4 (permalink)
Member
 
2sslow's Avatar
 
Join Date: Jun 2009
Location: Somewhere n da 404
Posts: 2,237
Likes Received: 0
Thanks: 247
Thanked 1,039 Times in 551 Posts
Default

works great thanks!
Might want to change to:
Code:
cd /
mount -o remount,rw /
vi /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js

Depending what mods have been done to your bar-assistant.js file the line you are looking for is around 2350 +_



Doug

Last edited by 2sslow; 08/31/2009 at 11:03 PM.
2sslow is offline   Reply With Quote
Old 08/27/2009, 09:51 AM   #5 (permalink)
Member
 
Join Date: Nov 2003
Posts: 334
Likes Received: 0
Thanks: 20
Thanked 22 Times in 9 Posts
Default

Glad it worked for you guys. Now a new question - any idea on modifying the lock screen? I've been banging around in com.palm.app.screenlock and can't find much of anything to help me add date and other info to it. I do not understand why 1.) this screen doesn't already have the date and 2.) why this isn't configurable.

Thanks
dirtygreek is offline   Reply With Quote
Old 08/27/2009, 11:15 AM   #6 (permalink)
Member
 
BMIC50's Avatar
 
Join Date: Jul 2004
Location: Boo-val,FL
Posts: 2,545
Likes Received: 130
Thanks: 176
Thanked 161 Times in 129 Posts
Default

Quote:
Originally Posted by dirtygreek View Post
Glad it worked for you guys. Now a new question - any idea on modifying the lock screen? I've been banging around in com.palm.app.screenlock and can't find much of anything to help me add date and other info to it. I do not understand why 1.) this screen doesn't already have the date and 2.) why this isn't configurable.

Thanks
The Lock screen already shows the date. It shows where at the top (where the time is displayed on the launcher).
BMIC50 is offline   Reply With Quote
Old 08/31/2009, 02:39 AM   #7 (permalink)
Member
 
maddball's Avatar
 
Join Date: Jul 2009
Posts: 239
Likes Received: 0
Thanks: 114
Thanked 23 Times in 15 Posts
Default

I'm trying to change the Large clock color on the locked screen.. Any clues where t look?
Thanks in advance..
__________________
How many times have you seen the Dr.?..lol
maddball is offline   Reply With Quote
Old 08/31/2009, 05:34 AM   #8 (permalink)
Member
 
hmagoo's Avatar
 
Join Date: Jun 2009
Location: Palm Desert, CA
Posts: 249
Likes Received: 1
Thanks: 38
Thanked 47 Times in 22 Posts
Default

Quote:
Originally Posted by 2sslow View Post
works great thanks!
Might want to change to:
Code:
cd /
Mount -o remount,rw /
vi /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
Depending what mods have been done to your bar-assistant.js file the line you are looking for is around 2350 +_
Doug
for me it was 2305, and btw,
its
Code:
sudo -i
cd /
mount -o remount,rw /
vi /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
mount -o remount,ro /
capitalization error in Mount
__________________

hmagoo is offline   Reply With Quote
Old 08/31/2009, 10:47 PM   #9 (permalink)
Member
 
Webby_s's Avatar
 
Join Date: May 2009
Posts: 284
Likes Received: 0
Thanks: 36
Thanked 22 Times in 17 Posts
Default

Why does it have that extra space between the date, {
This:
Code:
$('clock').innerHTML = Mojo.Format.formatDate(date, {date:'short',time:format});
where as the next line down it's
Code:
$('today').innerHTML = Mojo.Format.formatDate(date,{date:'short'});
Would that make any difference or am I reading into it too much? (trying to understand how to write these linux lines)

And could we get rid of the year.... So have it look like: 8/31 and not 8/31/09? Cuz I figure I know what year I am in.
__________________
Still happily rooting my launch 6/6/09 Pre!
(and my wife's)

Last edited by Webby_s; 08/31/2009 at 10:59 PM.
Webby_s is offline   Reply With Quote
Old 08/31/2009, 11:10 PM   #10 (permalink)
Member
 
Join Date: Jun 2009
Posts: 50
Likes Received: 0
Thanks: 5
Thanked 10 Times in 2 Posts
Default

Quote:
Originally Posted by maddball View Post
I'm trying to change the Large clock color on the locked screen.. Any clues where t look?
Thanks in advance..
I'm looking for the same thing--that font is pretty bad. I'd like to replace it with the analog clock from the Clock app, if possible.

Quick question: My time at the top slaps an extra zero in front of everything. Example, instead of "4:30" it will say "04:30". Any way of getting rid of this?
superkyol is offline   Reply With Quote
Old 09/01/2009, 12:07 AM   #11 (permalink)
Member
 
Join Date: Aug 2009
Posts: 57
Likes Received: 0
Thanks: 28
Thanked 3 Times in 3 Posts
Default

Quote:
Originally Posted by hmagoo View Post
for me it was 2305, and btw,
its
Code:
sudo -i
cd /
mount -o remount,rw /
vi /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
mount -o remount,ro /
capitalization error in Mount


Ok im a total newb so im going to ask you guys this question, after i type all this and scroll through the lines of code in putty how do i edit it??? it does not let me type anything in putty or delete anything, i try but it just doesnt do anything? can someone please explain to me in detail of to edit the line of code after i have found it or am i just an idiot?!?! any help would be greatly appericiated.

David
warguy is offline   Reply With Quote
Old 09/01/2009, 12:11 AM   #12 (permalink)
Member
 
Join Date: Jun 2009
Posts: 106
Likes Received: 0
Thanks: 66
Thanked 24 Times in 15 Posts
Default

Quote:
Originally Posted by Webby_s View Post
Why does it have that extra space between the date, {
This:
Code:
$('clock').innerHTML = Mojo.Format.formatDate(date, {date:'short',time:format});
where as the next line down it's
Code:
$('today').innerHTML = Mojo.Format.formatDate(date,{date:'short'});
Would that make any difference or am I reading into it too much? (trying to understand how to write these linux lines)

And could we get rid of the year.... So have it look like: 8/31 and not 8/31/09? Cuz I figure I know what year I am in.
Hey,

The extra space doesn't matter. Javascript (as most programming languages) is pretty flexible with white space characters. It's just there to make the code more readable for the human eyes.
linwiz311 is offline   Reply With Quote
Old 09/01/2009, 12:38 AM   #13 (permalink)
Member
 
Join Date: Jun 2009
Posts: 15
Likes Received: 0
Thanks: 10
Thanked 14 Times in 6 Posts
Default

Quote:
Originally Posted by Webby_s View Post
And could we get rid of the year.... So have it look like: 8/31 and not 8/31/09? Cuz I figure I know what year I am in.
Something like this?

Code:
	var formedDate=Mojo.Format.formatDate(date, {date:'short'});
	formedDate=formedDate.substr(0,formedDate.lastIndexOf('/'));
	$('clock').innerHTML = formedDate+' '+Mojo.Format.formatDate(date, {time:format});
tk102 is offline   Reply With Quote
Thanked by 2sslow, hmagoo, Webby_s
Old 09/01/2009, 01:51 AM   #14 (permalink)
Member
 
Join Date: May 2009
Posts: 353
Likes Received: 0
Thanks: 7
Thanked 57 Times in 41 Posts
Default

Quote:
Originally Posted by warguy View Post
Ok im a total newb so im going to ask you guys this question, after i type all this and scroll through the lines of code in putty how do i edit it??? it does not let me type anything in putty or delete anything, i try but it just doesnt do anything? can someone please explain to me in detail of to edit the line of code after i have found it or am i just an idiot?!?! any help would be greatly appericiated.

David
It's editing using vi. There's a whole page dedicated to it on the wiki, under "Linux Basics" or something like that. Basically, hitting i puts you in edit mode, the Esc key back out of edit mode, then type :wq to save. But first, read up on how to use vi.
pullbangdead is offline   Reply With Quote
Old 09/01/2009, 11:18 AM   #15 (permalink)
Member
 
Join Date: Jul 2009
Posts: 42
Likes Received: 0
Thanks: 17
Thanked 2 Times in 2 Posts
Default

Thanks everyone. Worked perfect for me.

Jason
SFWD1934 is offline   Reply With Quote
Old 09/01/2009, 03:00 PM   #16 (permalink)
Member
 
Webby_s's Avatar
 
Join Date: May 2009
Posts: 284
Likes Received: 0
Thanks: 36
Thanked 22 Times in 17 Posts
Default

Quote:
Originally Posted by tk102 View Post
Something like this?

Code:
	var formedDate=Mojo.Format.formatDate(date, {date:'short'});
	formedDate=formedDate.substr(0,formedDate.lastIndexOf('/'));
	$('clock').innerHTML = formedDate+' '+Mojo.Format.formatDate(date, {time:format});
Interesting!! I will have to try that when I get home... Anyone else try it? Screenshot?
__________________
Still happily rooting my launch 6/6/09 Pre!
(and my wife's)
Webby_s is offline   Reply With Quote
Old 09/01/2009, 09:10 PM   #17 (permalink)
Forum Leader
 
mamouton's Avatar
 
Join Date: Jan 2007
Location: Fort Worth, TX
Posts: 5,771
Likes Received: 5
Thanks: 796
Thanked 1,165 Times in 801 Posts
Default

Quote:
Originally Posted by superkyol View Post
I'm looking for the same thing--that font is pretty bad. I'd like to replace it with the analog clock from the Clock app, if possible.

Quick question: My time at the top slaps an extra zero in front of everything. Example, instead of "4:30" it will say "04:30". Any way of getting rid of this?
Sounds like you have the clock set to display 24 hours instead of 12
mamouton is offline   Reply With Quote
Old 09/01/2009, 11:26 PM   #18 (permalink)
Member
 
Webby_s's Avatar
 
Join Date: May 2009
Posts: 284
Likes Received: 0
Thanks: 36
Thanked 22 Times in 17 Posts
Default

Quote:
Originally Posted by tk102 View Post
Something like this?

Code:
	var formedDate=Mojo.Format.formatDate(date, {date:'short'});
	formedDate=formedDate.substr(0,formedDate.lastIndexOf('/'));
	$('clock').innerHTML = formedDate+' '+Mojo.Format.formatDate(date, {time:format});
Didn't work And I sure as heck don't have the knowledge to possibly change it to work.... (sure wish I did!)
Attached Images
File Type: jpg Unknown_2009-01-09_232151.jpg (66.8 KB, 105 views) Email Attachment
__________________
Still happily rooting my launch 6/6/09 Pre!
(and my wife's)
Webby_s is offline   Reply With Quote
Old 09/01/2009, 11:49 PM   #19 (permalink)
Member
 
2sslow's Avatar
 
Join Date: Jun 2009
Location: Somewhere n da 404
Posts: 2,237
Likes Received: 0
Thanks: 247
Thanked 1,039 Times in 551 Posts
Default

Works for me



















2sslow is offline   Reply With Quote
Old 09/01/2009, 11:52 PM   #20 (permalink)
Forum Leader
 
mamouton's Avatar
 
Join Date: Jan 2007
Location: Fort Worth, TX
Posts: 5,771
Likes Received: 5
Thanks: 796
Thanked 1,165 Times in 801 Posts
Default

I love that black theme please share the steps or backgrounds you used. Also how did you get rid of the year in the clock mod.
mamouton is offline   Reply With Quote
Reply

 

Tags
date, time

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0