Google Tasks
संग्रह की मदद से व्यवस्थित रहें अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
काम की सूची से काम पाएं
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); } }
टास्क बनाना
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); }
काम को संपन्न के रूप में चिह्नित करें
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); }
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-21 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-08-21 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThe code demonstrates how to retrieve tasks from the default Google Tasks list, including details like title, due date, status, and ID.\u003c/p\u003e\n"],["\u003cp\u003eIt showcases the creation of a new task with a title, notes, and a due date set for 5 days from the current date.\u003c/p\u003e\n"],["\u003cp\u003eThe provided example illustrates how to mark a task as completed by updating its status using the task ID and task list ID.\u003c/p\u003e\n"]]],[],null,["Get tasks from task list \n\n```transact-sql\nfunction getTasksFromDefaultList() {\n // You can substitute a task list ID here to retrieve all the tasks\n // in that list.\n\n var TASK_LIST_ID = '@default';\n\n var taskList = Tasks.Tasklists.get(TASK_LIST_ID);\n\n // Display the task list details.\n console.log('Name: %s (%s)', taskList.title, taskList.id);\n\n // Retrieve all the tasks in the list.\n var tasks = Tasks.Tasks.list(TASK_LIST_ID);\n\n for (var i = 0; i \u003c tasks.items.length; i++) {\n console.log(' %s) Title: %s, Due on: %s, Status: %s, ID = %s.',\n i.toFixed(0), tasks.items[i].title,\n tasks.items[i].due ? tasks.items[i].due : 'Never',\n tasks.items[i].status, tasks.items[i].id);\n }\n}\n```\n\nCreate a task \n\n```gdscript\nfunction createTask() {\n // You can substitute a task list ID here to create the task in a\n // specific list.\n\n var TASK_LIST_ID = '@default';\n\n var task = Tasks.newTask();\n task.title = 'Run reports';\n task.notes = 'Run account performance report in 5 days.';\n\n var dueDate = new Date();\n dueDate.setDate(dueDate.getDate() + 5);\n task.due = dueDate.toISOString();\n\n var newTask = Tasks.Tasks.insert(task, TASK_LIST_ID);\n console.log('Task with title = %s, id = %s and notes = %s was created. ' +\n 'Task is due on %s.',\n newTask.title, newTask.id, newTask.notes, newTask.due);\n}\n```\n\nMark task as completed \n\n```gdscript\nfunction markTaskAsCompleted() {\n var TASK_ID = 'INSERT_TASK_ID_HERE';\n var TASK_LIST_ID = '@default';\n\n // Retrieve the task.\n var task = Tasks.Tasks.get(TASK_LIST_ID, TASK_ID);\n task.status = 'completed';\n\n var updatedTask = Tasks.Tasks.update(task, TASK_LIST_ID, TASK_ID);\n console.log('Task with title = %s, id = %s and notes = %s was marked ' +\n 'as complete.', updatedTask.title, updatedTask.id,\n updatedTask.notes);\n}\n```"]]