Advertisement
Advertisement
| 04.25.2008 at 06:29AM PDT, ID: 23353387 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title> between </title>
<script type='text/javascript'>
//----------------------------------------------------------------------------
// Name: field()
// Role: Locate the document with the specified id
//----------------------------------------------------------------------------
function field( id ) {
var ele = document.getElementById( id );
if ( !ele ) {
alert( 'Specified document element not found. id="' + id + '"' );
}
return ele;
}
//----------------------------------------------------------------------------
// Name: padout()
// Role: prepend a leading '0' to values < 10 (e.g., 0..9)
//----------------------------------------------------------------------------
function padout( number ) {
return ( number < 10 ) ? '0' + number : number;
}
//----------------------------------------------------------------------------
// Name: showDates()
// Role: Generate all the dates in the specified range
//----------------------------------------------------------------------------
function showDates( startDate, endDate ) {
var result = '';
while ( startDate < endDate ) {
result += '\n' + startDate.getFullYear() + '-' + padout( startDate.getMonth() + 1 ) + '-' + padout( startDate.getDate() );
// add a day to the date:
startDate.setDate( startDate.getDate() + 1 );
}
return result.substring( 1 );
}
//----------------------------------------------------------------------------
// Name: checkDates()
// Role: Verify user input & generate requested dates for valid values.
//----------------------------------------------------------------------------
function checkDates( startId, stopId, outputId ) {
var start = field( startId );
var stop = field( stopId );
var output = field( outputId );
var dateRE = /^(\d{2,4})-(\d{1,2})-(\d{1,2})$/;
var startDate = null;
var stopDate = null;
if ( start && start.value.match( dateRE ) ) {
var startDate = new Date( RegExp.$1, RegExp.$2 - 1, RegExp.$3 );
}
if ( stop && stop.value.match( dateRE ) ) {
var stopDate = new Date( RegExp.$1, RegExp.$2 - 1, RegExp.$3 );
}
if ( output ) {
output.innerHTML = showDates( startDate, stopDate );
}
}
</script>
</head>
<body>
<table border='1'>
<tr>
<td>Start date:</td>
<td><input type='text' size='10' id='start' onchange='checkDates("start","stop","results")' value='YYYY-MM-DD'></td>
</tr>
<tr>
<td>End date:</td>
<td><input type='text' size='10' id='stop' onchange='checkDates("start","stop","results")' value='YYYY-MM-DD'></td>
</tr>
</table>
<textarea id='results'></textarea>
</body>
</html>
|