Skip to content
This repository was archived by the owner on Aug 21, 2018. It is now read-only.

Commit 4ee2cb4

Browse files
Rupesh87lmmrssa
authored andcommitted
[#870] Survey different download button name
1 parent 65905bb commit 4ee2cb4

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

app/nation/app/Router.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)