Page 1 of 1

[Solved] Insert alert to buy the book

Posted: Thu Mar 30, 2017 9:07 am
by Alex Ivanovich
this code was created by Dave (LotsOCds ;), It is only a portion

Code: Select all

<xsl:if test="publishdate/@unformatted>concat(substring(/data/@unformatteddate,1,6),'00') and dateacquired=''">
I wanted him to explain the code on the date :roll:

especially this part

Code: Select all

1,6),'00'
thanky

Re: Insert alert to buy the book

Posted: Sat Apr 01, 2017 7:43 pm
by LotsOCds
This code shows the alert whenever the dateacquired is blank AND the publishdate is either "in the present month" or "in the future". We do this by replacing the number for the present day of the month with "00" then see if the publishdate is greater.

Re: Insert alert to buy the book

Posted: Mon Apr 03, 2017 8:13 am
by Alex Ivanovich
hello Dave
sorry for the late response
Yes,
the function of the code know,
I had done to you the request to create it

I wanted to know how to understand this piece of code :roll:

Code: Select all

1,6),'00'
1,6 what is it?
month? day? :roll:

00
empty? :roll:

because 'I ask this?
if one day I would change the warning, take it one week, two months, or a year
I need to know what to enter in the code

thanks

Re: Insert alert to buy the book

Posted: Tue Apr 04, 2017 4:38 am
by LotsOCds
Example:
/data/@unformatteddate = "20170331"
publishdate/@unformatted = "20170315"

Code: Select all

<xsl:if test="publishdate/@unformatted>concat(substring(/data/@unformatteddate,1,6),'00') and dateacquired=''">
"The substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument."
substring(/data/@unformatteddate,1,6) = substring("20170331",1,6) = "201703"

"The concat function returns the concatenation of its arguments."
concat(substring(/data/@unformatteddate,1,6),'00') = concat("201703","00") = "20170300"

publishdate/@unformatted>concat(substring(/data/@unformatteddate,1,6),'00') = "20170315">"20170300" = True

Re: Insert alert to buy the book

Posted: Tue Apr 04, 2017 6:46 am
by Alex Ivanovich
thanks for the explanation Dave ;)