One line of code compares the age of user A and user B (calculated on two dates), one line

Source: Internet
Author: User

One line of code compares the age of user A and user B (calculated on two dates), one line

Two date calculation

Usage:

<Edate [id = schoolbag name] [list]>
<We start = "start Date" end = "end Date" [format = "yyyy-MM-dd HH: mm: ss. SSS"]/>

</Edate>

· Id: schoolbag name. The name of the schoolbag returned by the EDate label. Optional. If it is null, the schoolbag name is the tag name edate.

· List: list (Optional). Do you want to list all dates from start to end?

· Start: start date, for example, 00:00:00. 000

· End: end date, for example, 23:59:59. 999

· Format: format, Date format

Example 0:

Compare the age of user A and user B

Birthday of two people

<bag id=pPage>  <we name=userABirthday>1987-02-02</we>  <we name=userBBirthday>1989-09-18</we></bag>
One line of code compares the age of user A and user B
<edate id=test><we start="@{pPage:userABirthday}"end="@{pPage:userBBirthday}" /></edate>
Output comparison results
<If x = "@ {test: after} "> <p x = 1> <B> User A </B> is older than <B> User B </B> @ {test: y} years old and @ {int: @ {test: month }%12} months </p> <p x =-1> <B> User A </B> is younger than <B> User B </B> @{ test: y} years old and @ {int: @ {test: month} % 12} months </p> </if>
Complete computing information output
<B> complete output </B> <table border = 1> <tr> <th> key </th> <th> value </th> </tr> <end = "@ {test: getWidth} "> <tr> <td >@{ test :@{ for: getSuffix }}</td> <td >@{ test :@{ test :{: getSuffix }}</td> </tr> </for> </table>
Effect

Complete code

<Html> <title> compare the age of user A and user B </title> 

Pass@ {Test: key}You can retrieve the expected results.

(Example file: _ samples/date-2birthday.html) inLight PlatformUnder the _ samples Directory

Download Easy Do IT resources

Platform and the latest development manual free download: http://download.csdn.net/detail/tx18/8464425

Development Instance:Light B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8318585

The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please note thatDownload the latest version


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.