diff options
author | Struan Donald <struan@exo.org.uk> | 2012-11-01 13:28:42 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-11-01 13:45:04 +0000 |
commit | ed72a19ed6d15df10091163d5df29f4f154918c3 (patch) | |
tree | 91a54f93bec3140d2c589ca3f855501f3c5b425d /www/js | |
parent | 79c8eb9bb2d02655b241ca0636208f4b64a96e34 (diff) |
add and display date for saved reports
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/mobile.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/www/js/mobile.js b/www/js/mobile.js index 8a9d0e4..9da0ecb 100644 --- a/www/js/mobile.js +++ b/www/js/mobile.js @@ -446,7 +446,8 @@ function get_report_params () { lat: $('#fixmystreet\\.latitude').val(), lon: $('#fixmystreet\\.longitude').val(), phone: $('#form_phone').val(), - pc: $('#pc').val() + pc: $('#pc').val(), + time: new Date() }; if ( localStorage.username && localStorage.password && localStorage.name ) { @@ -489,7 +490,15 @@ function display_saved_reports() { for ( i = 0; i < r.length; i++ ) { if ( r[i] && r[i].title ) { var item = $('<li class="saved-report" id="' + i + '"></li>'); - var content = $('<a class="text"><h4>' + r[i].title + '</h4></a>'); + var date; + if ( r[i].time ) { + var date = new Date( r[i].time ); + date = date.getDate() + '-' + ( date.getMonth() + 1 ) + '-' + date.getFullYear(); + date += ' ' + date.getHour() + ':' + date.getMinute(); + } else { + date = ''; + } + var content = $('<a class="text"><h4>' + r[i].title + '</h4><small>' + date + '</small></a>'); if ( r[i].file ) { $('<img class="img" src="' + r[i].file + '" height="60" width="90">').prependTo(content); } |