Source language: Translate to:

DATES...JS

Share sample pubs, scripts, etc. with other NeoBook users

Moderator: Neosoft Support

DATES...JS

Postby virger » Tue May 05, 2009 10:53 am

. Create a WebBrowser name "WB"

.setvar "[ThaDate]" "!mm/dd/yyyy"

.setvar "[ThaDate]" "01/01/2009"
.NeoBook Vars:
. vNumYear----- 2009
. vNumDay------ 1
. vNumMonth---- 1 << vdate.getMonth()+1 >>
. vDayWeek----- 5 << vdate.getDay() +1 >>

. To use with:
. strparse "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Set,Oct,Nov,Dec"
. strparse "Sun,Mon,Tue,Wen,Thu,Fri,Sat"

. setvar "[vDate]" "[days[vDayWeek]] [vNumDay] of [moths[vNumMonth]] [vNumYear]"


......
Ussing in Button:

BrowserLoadFromStr "WB" "<body></body>"
BrowserExecScript "WB" "var vdate = new Date([#34][thedate][#34]);|window.external.nbExecAction( ' SetVar [#34]vnumyear[#34] [#34]'+vdate.getYear() +'[#34] ' );|window.external.nbExecAction( ' SetVar [#34]vnumday[#34] [#34]' +vdate.getDate() +'[#34] ' );|window.external.nbExecAction( ' SetVar [#34]vnummonth[#34] [#34]'+vdate.getMonth() +'+1[#34] ' );|window.external.nbExecAction( ' SetVar [#34]vdayweek[#34] [#34]' +vdate.getDay() +'+1[#34] ' );" "JScript"
=====

FROM COSTA RICA
CENTRAL AMERICA
PURA VIDA
User avatar
virger
 
Posts: 524
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Postby Neosoft Support » Tue May 05, 2009 3:08 pm

Good example.

I think this script could also be implemented as a NeoBook function without the need to have a browser object.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to Sample NeoBook Pubs

Who is online

Users browsing this forum: No registered users and 1 guest

cron