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

Commit

Permalink
[#870] Survey different download button name
Browse files Browse the repository at this point in the history
  • Loading branch information
Rupesh87 authored and lmmrssa committed Oct 30, 2017
1 parent 65905bb commit 4ee2cb4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/nation/app/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -3240,6 +3240,9 @@ $(function() {

downloadCommunitySurveys: function (surveyNo, surTitle, questionId) {
var that = this;
var fullDate = new Date()
var twoDigitMonth = ((fullDate.getMonth().length+1) === 1)? (fullDate.getMonth()+1) :(fullDate.getMonth()+1);
var currentDate = fullDate.getDate() + "-" + twoDigitMonth + "-" + fullDate.getFullYear();;
$.ajax({
url:'/surveyresponse/_design/bell/_view/surveyResBySurveyNo?include_docs=true',
type: 'GET',
Expand Down Expand Up @@ -3320,7 +3323,11 @@ $(function() {
if(jsonObjectsData.length > 0) {
jsonObjectsData.sort(that.sortByProperty('QStatement'));
jsonObjectsData.sort(that.sortByProperty('QType'));
that.JSONToCSVConvertor(jsonObjectsData, surveyTitle+ '/' + surveyNo);
if(questionId == ''){
that.JSONToCSVConvertor(jsonObjectsData, surveyTitle+ '/' + surveyNo+ '/' + currentDate);
}else{
that.JSONToCSVConvertor(jsonObjectsData, surveyTitle+ '/' + questionId);
}
} else {
alert("All the questions are un-answered, so unable to download data");
}
Expand Down

0 comments on commit 4ee2cb4

Please sign in to comment.