Project

Profile

Help

Support #4888 ยป browser - 2021-02-02T08_45_30Z.eml

John Lumley, 2021-02-02 09:45

 
X-He-Spam-Score: 0.2
Return-Path: <john@saxonica.com>
Delivered-To: dropbox@plan.io
Received: from m.launch.gmbh ([127.0.0.1])
by m.launch.gmbh with LMTP id +F/hGxARGWDLagAAJzdhvw
for <dropbox@plan.io>; Tue, 02 Feb 2021 09:45:04 +0100
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on m.launch.gmbh
X-Spam-Level:
X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,DMARC_NONE,
HTML_MESSAGE,MIME_QP_LONG_LINE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,
SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no
version=3.4.2
X-Spam-Report:
* 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was
* blocked. See
* http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
* for more information.
* [URIs: plan.io]
* -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
* [score: 0.0000]
* 2.0 SPF_NONE SPF record not found
* 0.1 DMARC_NONE DMARC record not found
* 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3)
* [94.136.40.144 listed in wl.mailspike.net]
* 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
* 0.0 HTML_MESSAGE BODY: HTML included in message
* 0.0 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76
* chars
* 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders
X-Spam-Score: 0.2
X-Greylist: delayed 947 seconds by postgrey-1.36 at m.launch.gmbh; Tue, 02 Feb 2021 09:45:04 CET
Authentication-Results: m.launch.gmbh; dmarc=none (p=none dis=none) header.from=saxonica.com
Authentication-Results: m.launch.gmbh; spf=none smtp.mailfrom=john@saxonica.com
Authentication-Results: m.launch.gmbh; dkim=none; dkim-atps=neutral
Envelope-to: inbox+saxonica+f38e+saxon-js@plan.io
Received: from mailex.mailcore.me (mailex.mailcore.me [94.136.40.144])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by m.launch.gmbh (Postfix) with ESMTPS id 42E7981EB6
for <inbox+saxonica+f38e+saxon-js@plan.io>; Tue, 2 Feb 2021 09:45:04 +0100 (CET)
Received: from host86-142-81-160.range86-142.btcentralplus.com ([86.142.81.160] helo=[192.168.1.138])
by smtp03.mailcore.me with esmtpa (Exim 4.92.3)
(envelope-from <john@saxonica.com>)
id 1l6r3k-0000p2-NB
for inbox+saxonica+f38e+saxon-js@plan.io; Tue, 02 Feb 2021 08:29:17 +0000
Content-Type: multipart/alternative; boundary=Apple-Mail-5912DC90-F6DB-4A29-8028-3D3DF6FB285A
Content-Transfer-Encoding: 7bit
From: John Lumley <john@saxonica.com>
Mime-Version: 1.0 (1.0)
Subject: Re: [Saxon-JS - Support #4888] (New) Getting current-dateTime()/js:Date() in UI/browser
Date: Tue, 2 Feb 2021 08:29:15 +0000
Message-Id: <ED0156FC-CD33-40F4-B098-416FDDC5244C@saxonica.com>
References: <redmine.issue-4888.20210201230539.ca7827221c4413a3@plan.io>
In-Reply-To: <redmine.issue-4888.20210201230539.ca7827221c4413a3@plan.io>
To: Saxonica Developer Community <inbox+saxonica+f38e+saxon-js@plan.io>
X-Mailer: iPad Mail (18C66)
X-Mailcore-Auth: 439400283
X-Mailcore-Domain: 1881035


--Apple-Mail-5912DC90-F6DB-4A29-8028-3D3DF6FB285A
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: quoted-printable

Assuming you are using SaxonJS2 then you can use saxon:timestamp() which giv=
es the current time at the point of evaluation -

https://www.saxonica.com/documentation/index.html#!functions/saxon/timestamp=


Sent from my iPad

> On 1 Feb 2021, at 23:05, Saxonica Developer Community <notifications@plan.=
io> wrote:
>=20
> =EF=BB=BF
> --- In your reply, please do not write below this line ---
>=20
> Issue #4888 has been reported by David Cramer.
> Support #4888: Getting current-dateTime()/js:Date() in UI/browser
> Author: David Cramer
> Status: New
> Priority: Low
> Assignee:
> Category:
> Sprint/Milestone:
> Applies to JS Branch:
> Fix Committed on JS Branch:
> Fixed in JS Release:
> SEF Generated with:
> Company:
> Contact person:
> Additional contact persons:
> I have a UI in which I would like to display some duration info along side=
certain dates. E.g. "Today at 4:00 pm (2 minutes ago)". Implementing this i=
n xslt is easy enough, however the UI should really update this text as time=
marches on. If your browser stays open, at some point it should say "Yester=
day at 4:00 pm (9 hours ago)".
>=20
> The problem is that current-dateTime() always returns the time at which th=
e window was loaded. I assume this is a 'no side-effects' thing. I've tried i=
mplementing a JavaScript function that returns Date().toISOString(). That wo=
rks when the pages is loaded, but when the function is called a second time I=
'm getting "XError:ixsl:call: property 'isoDate' is not a function; code:SXJ=
S0007"
>=20
> This is pretty common thing to do in a UI, so I assume there's a way to do=
it with Saxon-JS that I haven't figured out. Any guidance would be apprecia=
ted!
>=20
> You have received this notification because you have either subscribed to o=
r are involved in a project on Saxonica Developer Community site. To change y=
our notification preferences, please click here: https://saxonica.plan.io/my=
/account?tour=3Dmail_preferences
>=20
>=20
> This notification was cheerfully delivered by

--Apple-Mail-5912DC90-F6DB-4A29-8028-3D3DF6FB285A
Content-Type: text/html;
charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto">Assuming you are using SaxonJS2 then you ca=
n use saxon:timestamp() which gives the current time at the point of evaluat=
ion -<div><br></div><div><a href=3D"https://www.saxonica.com/documentation/i=
ndex.html#!functions/saxon/timestamp">https://www.saxonica.com/documentation=
/index.html#!functions/saxon/timestamp</a><br><br><div dir=3D"ltr">Sent from=
my iPad</div><div dir=3D"ltr"><br><blockquote type=3D"cite">On 1 Feb 2021, a=
t 23:05, Saxonica Developer Community &lt;notifications@plan.io&gt; wrote:<b=
r><br></blockquote></div><blockquote type=3D"cite"><div dir=3D"ltr">=EF=BB=BF=



<!--[if !mso]><!-- -->
<link href=3D"https://assets.plan.io/stylesheets/fonts.css" rel=3D"styleshee=
t" type=3D"text/css">
<!--<![endif]-->

<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8"><st=
yle>a:link{color:#0088b7}
a:visited{color:#0088b7}
a:hover{color:#0088b7}
a:active{color:#0088b7}</style>

<table class=3D"planio_mail" width=3D"100%" cellspacing=3D"0" cellpadding=3D=
"0" style=3D"border-collapse:collapse;margin-bottom:1em;border:1px solid #bb=
b;padding:4px;border-spacing:0;margin-bottom:0;width:100%;border:none;paddin=
g:0">
<tbody><tr><td class=3D"planio_mail header" style=3D"border:1px solid #bbb;p=
adding:4px;text-align:center;width:100%;font-family:MarketWeb, Helvetica, Ar=
ial, sans-serif;font-size:0.8em;color:#D7D7D7;border:none;padding:0"><p>--- I=
n your reply, please do not write below this line ---</p></td></tr>
<tr><td class=3D"planio_mail" style=3D"border:1px solid #bbb;padding:4px;bor=
der:none;padding:0">Issue <a href=3D"https://saxonica.plan.io/issues/4888?pn=
=3D1" style=3D"color:#0088b7">#4888</a> has been reported by David Cramer.
<hr style=3D"width:100%;height:1px;background:#ccc;border:0;margin:1.2em 0">=

<h1 style=3D"font-family:&quot;ProximaNova-Bold&quot;, Helvetica, Arial, san=
s-serif;font-weight:normal;margin:0px;font-size:1.3em;line-height:1.4em"><a h=
ref=3D"https://saxonica.plan.io/issues/4888?pn=3D1" style=3D"color:#0088b7;t=
ext-decoration:none">Support #4888: Getting current-dateTime()/js:Date() in U=
I/browser</a></h1>

<ul class=3D"details" style=3D"color:#959595;margin-bottom:1.5em"><li><stron=
g>Author: </strong>David Cramer</li>
<li><strong>Status: </strong>New</li>
<li><strong>Priority: </strong>Low</li>
<li><strong>Assignee: </strong></li>
<li><strong>Category: </strong></li>
<li><strong>Sprint/Milestone: </strong></li>
<li><strong>Applies to JS Branch: </strong></li>
<li><strong>Fix Committed on JS Branch: </strong></li>
<li><strong>Fixed in JS Release: </strong></li>
<li><strong>SEF Generated with: </strong></li>
<li><strong>Company: </strong></li>
<li><strong>Contact person: </strong></li>
<li><strong>Additional contact persons: </strong></li></ul>

<p>I have a UI in which I would like to display some duration info along sid=
e certain dates. E.g. "Today at 4:00 pm (2 minutes ago)". Implementing this i=
n xslt is easy enough, however the UI should really update this text as time=
marches on. If your browser stays open, at some point it should say "Yester=
day at 4:00 pm (9 hours ago)".</p>
<p>The problem is that <code style=3D"font-family:Hack, Consolas, Menlo, &qu=
ot;Liberation Mono&quot;, Courier, monospace;font-size:85%;background-color:=
#ececec;word-wrap:break-word;border-radius:3px;padding:0.2em;margin:0">curre=
nt-dateTime()</code> always returns the time at which the window was loaded.=
I assume this is a 'no side-effects' thing. I've tried implementing a JavaS=
cript function that returns Date().toISOString(). That works when the pages i=
s loaded, but when the function is called a second time I'm getting "XError:=
ixsl:call: property 'isoDate' is not a function; code:SXJS0007"</p>
<p>This is pretty common thing to do in a UI, so I assume there's a way to d=
o it with Saxon-JS that I haven't figured out. Any guidance would be appreci=
ated!</p>


<div itemscope=3D"itemscope" itemtype=3D"http://schema.org/EmailMessage"><di=
v itemscope=3D"itemscope" itemprop=3D"action" itemtype=3D"http://schema.org/=
ViewAction"><link itemprop=3D"url" href=3D"https://saxonica.plan.io/issues/4=
888?pn=3D1"><meta itemprop=3D"name" content=3D"View Issue"></div><meta itemp=
rop=3D"description" content=3D"View this issue update on Planio"></div>

</td></tr>
<tr><td class=3D"planio_mail footer" style=3D"border:1px solid #bbb;padding:=
4px;font-size:0.8em;width:100%;border:none;padding:0"><hr style=3D"width:100=
%;height:1px;background:#ccc;border:0;margin:1.2em 0"><p>You have received t=
his notification because you have either subscribed to or are involved in a p=
roject on Saxonica Developer Community site.
To change your notification preferences, please click here: <a href=3D"https=
://saxonica.plan.io/my/account?tour=3Dmail_preferences" class=3D"external" s=
tyle=3D"color:#0088b7">https://saxonica.plan.io/my/account?tour=3Dmail_prefe=
rences</a></p></td></tr>
<tr><td class=3D"planio_mail planio_footer" style=3D"border:1px solid #bbb;p=
adding:4px;text-align:center;width:100%;font-family:MarketWeb, Helvetica, Ar=
ial, sans-serif;font-size:1.2em;color:#D7D7D7;border:none;padding:0"><br><di=
v><a href=3D"https://plan.io/" style=3D"color:#0088b7;color:#D7D7D7;text-dec=
oration:none">This notification was cheerfully delivered by</a></div></td></=
tr>
<tr><td class=3D"planio_mail planio_footer_logo" style=3D"border:1px solid #=
bbb;padding:4px;text-align:center;width:100%;border:none;padding:0"><a href=3D=
"https://plan.io/" title=3D"Planio" style=3D"color:#0088b7"><img src=3D"http=
s://assets.plan.io/images/planio_logo_gray_204x50.png" height=3D"25" width=3D=
"102" border=3D"0" alt=3D"Planio" style=3D"vertical-align:middle;border:none=
" data-unique-identifier=3D""></a></td></tr>
</tbody></table>


</div></blockquote></div></body></html>=

--Apple-Mail-5912DC90-F6DB-4A29-8028-3D3DF6FB285A--
    (1-1/1)