代码之家  ›  专栏  ›  技术社区  ›  Samiksha Jagtap

不可解析日期:偏移量23处的“2017-11-24T05:27:00.000z”

  •  0
  • Samiksha Jagtap  · 技术社区  · 8 年前

    addToCalendar . 在iOS上运行良好,但安卓会出现上述错误。

    var start_date = "2017-11-24T05:27:00.000Z";
    var end_date = "2017-11-27T05:27:00.000Z"
    
    const eventConfig = {title:'Event name', location:'Satara', notes:'Added event', startDate: start_date, endDate: end_date};
    
    addCalendarEvent(eventConfig) {
      AddCalendarEvent.presentNewCalendarEventDialog(eventConfig)
        .then(eventId => {
          // handle success (receives event id) or dismissing the modal (receives false)
          if (eventId) {
            alert('Event Created');
          } else {
            console.warn('dismissed');
          }
        })
        .catch((error: string) => {
          // handle error such as when user rejected permissions
          console.warn(error);
        });
    }
    
    1 回复  |  直到 8 年前
        1
  •  1
  •   user926721 user926721    8 年前

    我猜你在用这个模块 react-native-add-calendar-event .
    请检查您使用的版本,因为我可以看到这个 issue 已经 fixed 不久前

    推荐文章