#79 fixing bug

This commit is contained in:
ASH 2019-04-30 22:05:57 +04:00
parent b4c11a7f90
commit 7ce8b20841
2 changed files with 14 additions and 3 deletions

View File

@ -130,12 +130,15 @@ public class TaskService {
return newTask;
}
@Transactional
public void generateYearTasks() {
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
List<Task> tasks = taskRepository.findToGenerate(cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.YEAR));
System.out.println(cal.get(Calendar.DAY_OF_MONTH) + " " + cal.get(Calendar.MONTH));
tasks.forEach(task -> taskRepository.save(copyYearTask(task)));
List<Task> tasks = taskRepository.findToGenerate(cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.YEAR) - 1);
tasks.forEach(task -> {
Task newTask = copyYearTask(task);
taskRepository.save(newTask);
});
}
public List<Task.TaskStatus> getTaskStatuses() {

View File

@ -21,6 +21,14 @@ $(document).ready(function () {
$("#input-tag").keyup(function (event) {
if(event.keyCode == 13 || event.keyCode == 188) {
var tagNumber = $("#tags .tag").length;
if(length != 0) {
tagNumber = $("#tags .tag").last()
.children('input')
.attr("name")
.split(']')[0]
.split('[')[1];
tagNumber++;
}
var tagName = $.trim($(this).val());
var addTag = true;
// проверка, добавлен ли этот тег