This repository was archived by the owner on Aug 21, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3240,6 +3240,9 @@ $(function() {
32403240
32413241 downloadCommunitySurveys : function ( surveyNo , surTitle , questionId ) {
32423242 var that = this ;
3243+ var fullDate = new Date ( )
3244+ var twoDigitMonth = ( ( fullDate . getMonth ( ) . length + 1 ) === 1 ) ? ( fullDate . getMonth ( ) + 1 ) :( fullDate . getMonth ( ) + 1 ) ;
3245+ var currentDate = fullDate . getDate ( ) + "-" + twoDigitMonth + "-" + fullDate . getFullYear ( ) ; ;
32433246 $ . ajax ( {
32443247 url :'/surveyresponse/_design/bell/_view/surveyResBySurveyNo?include_docs=true' ,
32453248 type : 'GET' ,
@@ -3320,7 +3323,11 @@ $(function() {
33203323 if ( jsonObjectsData . length > 0 ) {
33213324 jsonObjectsData . sort ( that . sortByProperty ( 'QStatement' ) ) ;
33223325 jsonObjectsData . sort ( that . sortByProperty ( 'QType' ) ) ;
3323- that . JSONToCSVConvertor ( jsonObjectsData , surveyTitle + '/' + surveyNo ) ;
3326+ if ( questionId == '' ) {
3327+ that . JSONToCSVConvertor ( jsonObjectsData , surveyTitle + '/' + surveyNo + '/' + currentDate ) ;
3328+ } else {
3329+ that . JSONToCSVConvertor ( jsonObjectsData , surveyTitle + '/' + questionId ) ;
3330+ }
33243331 } else {
33253332 alert ( "All the questions are un-answered, so unable to download data" ) ;
33263333 }
You can’t perform that action at this time.
0 commit comments