-
Date format setting or system toggle options
From
Nightfox@VERT/DIGDIST to
All on Wed Jul 30 20:10:43 2014
Hi all,ããIn Synchronet JavaScript, does anyone know if there's a way to get the settingãfor whether to use European date format (as under SCFG > System > ToggleãOptions > European Date Format (DD/MM/YY))? I've checked in the SynchronetãJavaScript Object Model Reference but I'm not seeing where that might beãavailable in JavaScript:ã
http://www.synchro.net/docs/jsobjs.htmlããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.comã
-
From
echicken@VERT/ECBBS to
Nightfox on Thu Jul 31 01:24:25 2014
Re: Date format setting or system toggle optionsã By: Nightfox to All on Wed Jul 30 2014 20:10:43ãã Ni> In Synchronet JavaScript, does anyone know if there's a way to get theã Ni> setting for whether to use European date format (as under SCFG > System >ã Ni> Toggle Options > European Date Format (DD/MM/YY))? I've checked in theã Ni> Synchronet JavaScript Object Model Reference but I'm not seeing where thatããI don't think that setting is exposed to the JS environment, however theãoutput of the system.datestr method is dictated by it.ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-273-7230ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
-
From
Nightfox@VERT/DIGDIST to
echicken on Thu Jul 31 07:36:22 2014
Re: Date format setting or system toggle optionsã By: echicken to Nightfox on Thu Jul 31 2014 01:24:25ãã Ni>> In Synchronet JavaScript, does anyone know if there's a way to getã Ni>> the setting for whether to use European date format (as under SCFG >ãã ec> I don't think that setting is exposed to the JS environment, however theã ec> output of the system.datestr method is dictated by it.ããThanks. Maybe there is a way to figure out the date format being used withãthat.. I'll have to look into that.ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.comã
-
From
echicken@VERT/ECBBS to
Nightfox on Thu Jul 31 11:02:30 2014
Re: Date format setting or system toggle optionsã By: Nightfox to echicken on Thu Jul 31 2014 07:36:22ãã Ni> Thanks. Maybe there is a way to figure out the date format being usedã Ni> with that.. I'll have to look into that.ããProbably something like:ããif(strftime("%d/%m/%y") == system.datestr()) {ã // Format in use is dd/mm/yyã} else {ã // Format in use is mm/dd/yyã}ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-273-7230ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
-
From
echicken@VERT/ECBBS to
Nightfox on Thu Jul 31 13:17:37 2014
Re: Date format setting or system toggle optionsã By: echicken to Nightfox on Thu Jul 31 2014 11:02:30ãã ec> if(strftime("%d/%m/%y") == system.datestr()) {ã ec> // Format in use is dd/mm/yyã ec> } else {ã ec> // Format in use is mm/dd/yyã ec> }ããOr perhaps better:ããvar t = time();ãvar dmy = (strftime("%d/%m/%y", t) == system.datestr(t)) ? true : false;ããWhich is probably overly cautious, and you could just do:ããvar dmy = (strftime("%d/%m/%y") == system.datestr()) ? true : false;ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-273-7230ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
-
From
Nightfox@VERT/DIGDIST to
echicken on Thu Jul 31 19:56:10 2014
Re: Date format setting or system toggle optionsã By: echicken to Nightfox on Thu Jul 31 2014 13:17:37ãã ec> Or perhaps better:ãã ec> var t = time();ã ec> var dmy = (strftime("%d/%m/%y", t) == system.datestr(t)) ? true : false;ãã ec> Which is probably overly cautious, and you could just do:ãã ec> var dmy = (strftime("%d/%m/%y") == system.datestr()) ? true : false;ããThanks. :)ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.comã
-
From
Nightfox@VERT/DIGDIST to
echicken on Thu Jul 31 19:58:08 2014
Re: Date format setting or system toggle optionsã By: Nightfox to echicken on Thu Jul 31 2014 19:56:10ãã ec>> var t = time();ã ec>> var dmy = (strftime("%d/%m/%y", t) == system.datestr(t)) ? true :ã ec>> false;ãã Ni> Thanks. :)ããBy the way, the ? true : false is redundant. This should be enough to get aãboolean value:ãvar dmy = (strftime("%d/%m/%y", t) == system.datestr(t));ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.comã
-
From
echicken@VERT/ECBBS to
Nightfox on Thu Jul 31 23:25:16 2014
Re: Date format setting or system toggle optionsã By: Nightfox to echicken on Thu Jul 31 2014 19:58:08ãã Ni> By the way, the ? true : false is redundant. This should be enough to getã Ni> a boolean value:ã Ni> var dmy = (strftime("%d/%m/%y", t) == system.datestr(t));ããIndeed - didn't really give it a ton of thought (I don't normally use theãshorthand if ... else in quite that way.)ããI'm trying to guess at why you want to determine the value of this setting inãthe first place - figuring out how to format a field label or column heading?ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-273-7230ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
-
From
Nightfox@VERT/DIGDIST to
echicken on Fri Aug 1 07:15:44 2014
Re: Date format setting or system toggle optionsã By: echicken to Nightfox on Thu Jul 31 2014 23:25:16ãã ec> I'm trying to guess at why you want to determine the value of thisã ec> setting in the first place - figuring out how to format a field label orã ec> column heading?ããYeah, I had an idea for a custom new user application script for ANSI usersãthat would use more of a full-screen lightbar interface, and I wanted toãdisplay the date format for the birthday.ãIn general, it would be useful to know the configured date format for otherãinstances where you'd want to format a date for a label or column heading. Iãhave a message lister mod that I wrote that has a date header that this mightãbe useful for.. Not sure yet if I want to update it to detect the system dateãformat or leave it to use the YYYY-MM-DD format..ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.comã
-
From
Deuce@VERT/SYNCNIX to
echicken on Mon Aug 11 21:20:51 2014
Re: Date format setting or system toggle optionsã By: echicken to Nightfox on Thu Jul 31 2014 11:02 amãã > Probably something like:ã >ã > if(strftime("%d/%m/%y") == system.datestr()) {ã > // Format in use is dd/mm/yyã > } else {ã > // Format in use is mm/dd/yyã > }ããBetter off using a known time value to avoid misdetection when the day is the
same as the month. system.datestr() can take a time_t value, so use constants:ããif (system.datestr(1407817211) == "08/11/14")...ããAdjust for your timezone as needed.ãã---ã
http://DuckDuckGo.com/ a better search engine that respects your privacy.ã þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)ã
-
From
Deuce@VERT/SYNCNIX to
echicken on Mon Aug 11 21:23:03 2014
Re: Date format setting or system toggle optionsã By: Deuce to echicken on Mon Aug 11 2014 09:20 pmãã > Better off using a known time value to avoid misdetection when the day isã > the same as the month. system.datestr() can take a time_t value, so useã > constants:ããAh, it is available...ããload("sbbsdefs.js");ãif (system.setting & SYS_EURODATE)...ããã---ã
http://DuckDuckGo.com/ a better search engine that respects your privacy.ã þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)ã
-
From
echicken@VERT/ECBBS to
Deuce on Tue Aug 12 13:11:42 2014
Re: Date format setting or system toggle optionsã By: Deuce to echicken on Mon Aug 11 2014 21:23:03ãã De> load("sbbsdefs.js");ã De> if (system.setting & SYS_EURODATE)...ããDid not know about that one. Certainly makes it easier.ãã---ãechickenãelectronic chicken bbs - bbs.electronicchicken.com - 416-273-7230ã þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.comã
-
From
Nightfox@VERT/DIGDIST to
Deuce on Tue Aug 12 20:21:14 2014
Re: Date format setting or system toggle optionsã By: Deuce to echicken on Mon Aug 11 2014 21:23:03ãã De> Ah, it is available...ãã De> load("sbbsdefs.js");ã De> if (system.setting & SYS_EURODATE)...ããDo you mean system.settings ('s' at the end)? I see that mentioned in theãSynchronet JavaScript docs:ãwww.synchro.net/docs/jsobjs.html#systemãAlso, that documentation page says to see SS_* in sbbsdefs.js for bitãdefinitions; in sbbsdefs.js, there is a comment that says SS_* are forãbbs.sys_status and the SYS_* settings are for system.settings - So I'mãwondering if that documentation page needs to be updated?ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.comã
-
From
Deuce@VERT/SYNCNIX to
Nightfox on Wed Aug 13 02:27:52 2014
Re: Date format setting or system toggle optionsã By: Nightfox to Deuce on Tue Aug 12 2014 08:21 pmãã > Do you mean system.settings ('s' at the end)? I see that mentioned in theã > Synchronet JavaScript docs:ã > www.synchro.net/docs/jsobjs.html#systemã > Also, that documentation page says to see SS_* in sbbsdefs.js for bitã > definitions; in sbbsdefs.js, there is a comment that says SS_* are forã > bbs.sys_status and the SYS_* settings are for system.settings - So I'mã > wondering if that documentation page needs to be updated?ããYep and yep.ãã---ã
http://DuckDuckGo.com/ a better search engine that respects your privacy.ã þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)ã