MINIUI input Set default value, JS get year month notice, database NVL function use

Source: Internet
Author: User

2017-6-5 Monday

One of the requirements today is: The two-tax levy module enters the page filter time default is the current month of the previous one months, and according to the filter results display data, we use the framework of MINIUI.

Pit 1:

Default settings, just touch miniui, on the inside of the usage and operation is not familiar with, so I directly use jquery to find the time input box, set its Val attribute, found not to take effect, and later found that the data involved MINIUI to use MINIUI to provide the method. Set the default value code as follows:

//设置id为month2的input框的默认值mini.get(‘month2‘).setValue(nowDate);
Pit 2:

JS time to get the problem, get the month is to get the month is 0-11, if want to get the current month to do +1 operation, but my demand is to get last month, so do not have to do, for 0 when set to 12 can be:

var date = new Date();var month = date.getMonth();month = ((month == 0) ? (12) : (month));

Get the year's time more pit, according to the inertial thinking, get the month with getmonth, that get the year not to use getyear, then I really admire my small wit, the result of the problem came, output is not 2017, but 117, the reason for this problem I think may be when JS was born (92) , the browser standard has not been unified, resulting in getyear conversion rules in the current standard does not apply. Instead, the following is:

var year = date.getFullYear();
Pit 3:

If the field you want to query is null in an SQL query, but you want it to be null, how do i show a default value?

//有值为SUM(G_ZZS),为null显示0nvl(SUM(G_ZZS),0)
?

MINIUI input Set default value, JS get year month notice, database NVL function use

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.