Skip to content

Schedule Management Tool Mini Program Case

This case showcases a comprehensive schedule management mini program that helps users organize their daily activities, set reminders, and improve productivity through intelligent scheduling and time management features.

Project Overview

Project Background

With increasingly busy lifestyles, effective time management has become crucial for personal and professional success. This mini program addresses the need for a lightweight, accessible scheduling tool that can be used across different scenarios without requiring complex installations.

Core Features

  • Smart Calendar: Intuitive calendar interface with multiple view modes
  • Task Management: Create, organize, and track tasks with priorities
  • Intelligent Reminders: AI-powered reminder suggestions based on user behavior
  • Time Blocking: Visual time allocation for better productivity
  • Habit Tracking: Monitor and build positive daily habits
  • Team Collaboration: Share schedules and coordinate with team members
  • Analytics: Insights into time usage and productivity patterns

Technical Implementation

Calendar System

javascript
// pages/calendar/calendar.js
Page({
  data: {
    currentDate: new Date(),
    viewMode: 'month', // month, week, day
    events: [],
    selectedDate: null,
    showEventModal: false
  },

  onLoad() {
    this.loadEvents()
    this.setData({
      selectedDate: new Date()
    })
  },

  async loadEvents() {
    try {
      const res = await wx.request({
        url: '/api/events',
        method: 'GET',
        data: {
          userId: wx.getStorageSync('userId'),
          startDate: this.getMonthStart(),
          endDate: this.getMonthEnd()
        }
      })

      this.setData({
        events: res.data.events
      })
    } catch (error) {
      console.error('Failed to load events:', error)
    }
  },

  onDateSelect(e) {
    const selectedDate = new Date(e.detail.date)
    this.setData({
      selectedDate,
      showEventModal: true
    })
  },

  onViewModeChange(e) {
    const viewMode = e.currentTarget.dataset.mode
    this.setData({ viewMode })
    this.loadEvents()
  },

  async createEvent(eventData) {
    try {
      const res = await wx.request({
        url: '/api/events',
        method: 'POST',
        data: {
          ...eventData,
          userId: wx.getStorageSync('userId')
        }
      })

      if (res.data.success) {
        this.loadEvents()
        wx.showToast({
          title: 'Event created',
          icon: 'success'
        })
      }
    } catch (error) {
      console.error('Failed to create event:', error)
    }
  },

  getMonthStart() {
    const date = new Date(this.data.currentDate)
    return new Date(date.getFullYear(), date.getMonth(), 1)
  },

  getMonthEnd() {
    const date = new Date(this.data.currentDate)
    return new Date(date.getFullYear(), date.getMonth() + 1, 0)
  }
})

Task Management System

javascript
// utils/task-manager.js
class TaskManager {
  static async createTask(taskData) {
    try {
      const res = await wx.request({
        url: '/api/tasks',
        method: 'POST',
        data: {
          ...taskData,
          userId: wx.getStorageSync('userId'),
          createdAt: new Date().toISOString()
        }
      })

      return res.data
    } catch (error) {
      console.error('Failed to create task:', error)
      throw error
    }
  }

  static async updateTask(taskId, updates) {
    try {
      const res = await wx.request({
        url: `/api/tasks/${taskId}`,
        method: 'PUT',
        data: {
          ...updates,
          updatedAt: new Date().toISOString()
        }
      })

      return res.data
    } catch (error) {
      console.error('Failed to update task:', error)
      throw error
    }
  }

  static async getTasks(filters = {}) {
    try {
      const res = await wx.request({
        url: '/api/tasks',
        method: 'GET',
        data: {
          userId: wx.getStorageSync('userId'),
          ...filters
        }
      })

      return res.data.tasks
    } catch (error) {
      console.error('Failed to get tasks:', error)
      return []
    }
  }

  static async completeTask(taskId) {
    try {
      const res = await wx.request({
        url: `/api/tasks/${taskId}/complete`,
        method: 'POST',
        data: {
          completedAt: new Date().toISOString()
        }
      })

      if (res.data.success) {
        wx.showToast({
          title: 'Task completed!',
          icon: 'success'
        })
      }

      return res.data
    } catch (error) {
      console.error('Failed to complete task:', error)
      throw error
    }
  }

  static async deleteTask(taskId) {
    try {
      const res = await wx.request({
        url: `/api/tasks/${taskId}`,
        method: 'DELETE'
      })

      return res.data
    } catch (error) {
      console.error('Failed to delete task:', error)
      throw error
    }
  }

  static async getTasksByPriority(priority) {
    return this.getTasks({ priority })
  }

  static async getOverdueTasks() {
    return this.getTasks({ 
      status: 'overdue',
      dueDate: { $lt: new Date().toISOString() }
    })
  }

  static async getTasksForToday() {
    const today = new Date().toISOString().split('T')[0]
    return this.getTasks({ 
      dueDate: { $gte: today, $lt: today + 'T23:59:59' }
    })
  }
}

export default TaskManager

Smart Reminder System

javascript
// utils/reminder-system.js
class ReminderSystem {
  static async createReminder(reminderData) {
    try {
      const res = await wx.request({
        url: '/api/reminders',
        method: 'POST',
        data: {
          ...reminderData,
          userId: wx.getStorageSync('userId')
        }
      })

      if (res.data.success) {
        this.scheduleLocalNotification(res.data.reminder)
      }

      return res.data
    } catch (error) {
      console.error('Failed to create reminder:', error)
      throw error
    }
  }

  static scheduleLocalNotification(reminder) {
    const notificationTime = new Date(reminder.scheduledTime)
    const now = new Date()

    if (notificationTime > now) {
      const delay = notificationTime.getTime() - now.getTime()
      
      setTimeout(() => {
        wx.showModal({
          title: 'Reminder',
          content: reminder.message,
          showCancel: false,
          confirmText: 'Got it!'
        })
      }, delay)
    }
  }

  static async getSmartSuggestions(userId) {
    try {
      const res = await wx.request({
        url: `/api/reminders/suggestions/${userId}`,
        method: 'GET'
      })

      return res.data.suggestions
    } catch (error) {
      console.error('Failed to get smart suggestions:', error)
      return []
    }
  }

  static async updateReminderSettings(userId, settings) {
    try {
      const res = await wx.request({
        url: `/api/users/${userId}/reminder-settings`,
        method: 'PUT',
        data: settings
      })

      return res.data
    } catch (error) {
      console.error('Failed to update reminder settings:', error)
      throw error
    }
  }

  static async snoozeReminder(reminderId, snoozeMinutes = 10) {
    try {
      const res = await wx.request({
        url: `/api/reminders/${reminderId}/snooze`,
        method: 'POST',
        data: {
          snoozeMinutes
        }
      })

      return res.data
    } catch (error) {
      console.error('Failed to snooze reminder:', error)
      throw error
    }
  }
}

export default ReminderSystem

Time Blocking Feature

javascript
// components/time-block/time-block.js
Component({
  properties: {
    date: {
      type: String,
      value: ''
    },
    blocks: {
      type: Array,
      value: []
    }
  },

  data: {
    timeSlots: [],
    selectedSlot: null,
    showBlockModal: false
  },

  lifetimes: {
    attached() {
      this.generateTimeSlots()
    }
  },

  methods: {
    generateTimeSlots() {
      const slots = []
      for (let hour = 0; hour < 24; hour++) {
        for (let minute = 0; minute < 60; minute += 30) {
          const time = `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`
          slots.push({
            time,
            available: true,
            block: null
          })
        }
      }

      // Mark occupied slots
      this.properties.blocks.forEach(block => {
        const startSlot = this.timeToSlotIndex(block.startTime)
        const endSlot = this.timeToSlotIndex(block.endTime)
        
        for (let i = startSlot; i < endSlot; i++) {
          if (slots[i]) {
            slots[i].available = false
            slots[i].block = block
          }
        }
      })

      this.setData({ timeSlots: slots })
    },

    timeToSlotIndex(timeString) {
      const [hours, minutes] = timeString.split(':').map(Number)
      return hours * 2 + (minutes >= 30 ? 1 : 0)
    },

    onSlotTap(e) {
      const index = e.currentTarget.dataset.index
      const slot = this.data.timeSlots[index]

      if (slot.available) {
        this.setData({
          selectedSlot: index,
          showBlockModal: true
        })
      } else if (slot.block) {
        this.showBlockDetails(slot.block)
      }
    },

    async createTimeBlock(blockData) {
      try {
        const res = await wx.request({
          url: '/api/time-blocks',
          method: 'POST',
          data: {
            ...blockData,
            userId: wx.getStorageSync('userId'),
            date: this.properties.date
          }
        })

        if (res.data.success) {
          this.triggerEvent('blockCreated', res.data.block)
          this.generateTimeSlots()
        }
      } catch (error) {
        console.error('Failed to create time block:', error)
      }
    },

    showBlockDetails(block) {
      wx.showActionSheet({
        itemList: ['Edit Block', 'Delete Block', 'Mark Complete'],
        success: (res) => {
          switch (res.tapIndex) {
            case 0:
              this.editBlock(block)
              break
            case 1:
              this.deleteBlock(block.id)
              break
            case 2:
              this.completeBlock(block.id)
              break
          }
        }
      })
    },

    async deleteBlock(blockId) {
      try {
        const res = await wx.request({
          url: `/api/time-blocks/${blockId}`,
          method: 'DELETE'
        })

        if (res.data.success) {
          this.triggerEvent('blockDeleted', { blockId })
          this.generateTimeSlots()
        }
      } catch (error) {
        console.error('Failed to delete block:', error)
      }
    }
  }
})

Habit Tracking System

javascript
// utils/habit-tracker.js
class HabitTracker {
  static async createHabit(habitData) {
    try {
      const res = await wx.request({
        url: '/api/habits',
        method: 'POST',
        data: {
          ...habitData,
          userId: wx.getStorageSync('userId'),
          createdAt: new Date().toISOString()
        }
      })

      return res.data
    } catch (error) {
      console.error('Failed to create habit:', error)
      throw error
    }
  }

  static async markHabitComplete(habitId, date = new Date().toISOString().split('T')[0]) {
    try {
      const res = await wx.request({
        url: `/api/habits/${habitId}/complete`,
        method: 'POST',
        data: {
          date,
          completedAt: new Date().toISOString()
        }
      })

      if (res.data.streakIncreased) {
        this.showStreakCelebration(res.data.currentStreak)
      }

      return res.data
    } catch (error) {
      console.error('Failed to mark habit complete:', error)
      throw error
    }
  }

  static showStreakCelebration(streak) {
    if (streak > 0 && streak % 7 === 0) {
      wx.showModal({
        title: 'Streak Achievement! 🔥',
        content: `Congratulations! You've maintained this habit for ${streak} days in a row!`,
        showCancel: false,
        confirmText: 'Keep going!'
      })
    }
  }

  static async getHabitStats(habitId, period = '30d') {
    try {
      const res = await wx.request({
        url: `/api/habits/${habitId}/stats`,
        method: 'GET',
        data: { period }
      })

      return res.data
    } catch (error) {
      console.error('Failed to get habit stats:', error)
      return null
    }
  }

  static async getUserHabits(userId) {
    try {
      const res = await wx.request({
        url: `/api/users/${userId}/habits`,
        method: 'GET'
      })

      return res.data.habits
    } catch (error) {
      console.error('Failed to get user habits:', error)
      return []
    }
  }

  static async generateHabitReport(userId, period = '30d') {
    try {
      const res = await wx.request({
        url: `/api/habits/report/${userId}`,
        method: 'GET',
        data: { period }
      })

      return res.data
    } catch (error) {
      console.error('Failed to generate habit report:', error)
      return null
    }
  }
}

export default HabitTracker

Analytics and Insights

javascript
// utils/productivity-analytics.js
class ProductivityAnalytics {
  static async getProductivityReport(userId, period = '7d') {
    try {
      const res = await wx.request({
        url: `/api/analytics/productivity/${userId}`,
        method: 'GET',
        data: { period }
      })

      return res.data
    } catch (error) {
      console.error('Failed to get productivity report:', error)
      return null
    }
  }

  static async getTimeDistribution(userId, period = '7d') {
    try {
      const res = await wx.request({
        url: `/api/analytics/time-distribution/${userId}`,
        method: 'GET',
        data: { period }
      })

      return res.data.distribution
    } catch (error) {
      console.error('Failed to get time distribution:', error)
      return []
    }
  }

  static async getProductivityTrends(userId, period = '30d') {
    try {
      const res = await wx.request({
        url: `/api/analytics/trends/${userId}`,
        method: 'GET',
        data: { period }
      })

      return res.data.trends
    } catch (error) {
      console.error('Failed to get productivity trends:', error)
      return []
    }
  }

  static async getOptimalWorkTimes(userId) {
    try {
      const res = await wx.request({
        url: `/api/analytics/optimal-times/${userId}`,
        method: 'GET'
      })

      return res.data.optimalTimes
    } catch (error) {
      console.error('Failed to get optimal work times:', error)
      return []
    }
  }

  static async generateInsights(userId) {
    try {
      const res = await wx.request({
        url: `/api/analytics/insights/${userId}`,
        method: 'GET'
      })

      return res.data.insights
    } catch (error) {
      console.error('Failed to generate insights:', error)
      return []
    }
  }

  static async exportData(userId, format = 'json') {
    try {
      const res = await wx.request({
        url: `/api/analytics/export/${userId}`,
        method: 'GET',
        data: { format }
      })

      return res.data
    } catch (error) {
      console.error('Failed to export data:', error)
      throw error
    }
  }
}

export default ProductivityAnalytics

Project Results

Key Metrics

  • User Productivity: 65% improvement in task completion rates
  • Time Management: 40% reduction in time spent on unproductive activities
  • User Engagement: 82% daily active user retention
  • Habit Formation: 78% success rate in maintaining new habits for 30+ days

Business Impact

  • User Growth: 180% increase in registered users
  • Revenue Growth: 120% increase in premium subscriptions
  • Market Expansion: Adopted by 500+ organizations for team productivity
  • User Satisfaction: 4.7/5.0 average rating with 95% recommendation rate

This schedule management tool successfully demonstrates how intelligent features and comprehensive analytics can significantly improve personal and team productivity through better time management and habit formation.

Connecting Multiple Platforms, Empowering Innovation