Lista zadań Google
    
    
      
    
    
      
      Zadbaj o dobrą organizację dzięki kolekcji
    
    
      
      Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
    
  
    
  
      
    
  
  
  
  
  
    
    
    
  
  
    
    
    
Pobierz zadania z listy zadań
function getTasksFromDefaultList() {
  // You can substitute a task list ID here to retrieve all the tasks
  // in that list.
  var TASK_LIST_ID = '@default';
  var taskList = Tasks.Tasklists.get(TASK_LIST_ID);
  // Display the task list details.
  console.log('Name: %s (%s)', taskList.title, taskList.id);
  // Retrieve all the tasks in the list.
  var tasks = Tasks.Tasks.list(TASK_LIST_ID);
  for (var i = 0; i < tasks.items.length; i++) {
    console.log('  %s) Title: %s, Due on: %s, Status: %s, ID = %s.',
               i.toFixed(0), tasks.items[i].title,
               tasks.items[i].due ? tasks.items[i].due : 'Never',
               tasks.items[i].status, tasks.items[i].id);
  }
}
Tworzenie zadania
function createTask() {
  // You can substitute a task list ID here to create the task in a
  // specific list.
  var TASK_LIST_ID = '@default';
  var task = Tasks.newTask();
  task.title = 'Run reports';
  task.notes = 'Run account performance report in 5 days.';
  var dueDate = new Date();
  dueDate.setDate(dueDate.getDate() + 5);
  task.due = dueDate.toISOString();
  var newTask = Tasks.Tasks.insert(task, TASK_LIST_ID);
  console.log('Task with title = %s, id = %s and notes = %s was created. ' +
             'Task is due on %s.',
             newTask.title, newTask.id, newTask.notes, newTask.due);
}
Oznacz zadanie jako ukończone
function markTaskAsCompleted() {
  var TASK_ID = 'INSERT_TASK_ID_HERE';
  var TASK_LIST_ID = '@default';
  // Retrieve the task.
  var task = Tasks.Tasks.get(TASK_LIST_ID, TASK_ID);
  task.status = 'completed';
  var updatedTask = Tasks.Tasks.update(task, TASK_LIST_ID, TASK_ID);
  console.log('Task with title = %s, id = %s and notes = %s was marked ' +
             'as complete.', updatedTask.title, updatedTask.id,
             updatedTask.notes);
}
  
  
  
  
    
  
 
  
    
      
      
    
    
      
    
    
  
       
    
    
      
    
  
  
  O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
  Ostatnia aktualizacja: 2025-08-21 UTC.
  
  
  
    
      [[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-08-21 UTC."],[],[]]