这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ Returns: **Promise**
| [**alarms**](#alarms) | Array | The alarms associated with the calendar event, as an array of alarm objects. | ✓ | ✓ |
| [**attendees**](#attendees)* | Array | The attendees of the event, including the organizer. | ✓ | ✓ |
| [**calendar**](#calendar)* | Object | The calendar containing the event.| ✓ | ✓ |
| **skipAndroidTimezone** | Bool | Skip the process of setting automatic timezone on android| | ✓ |


### Calendar
Expand Down
9 changes: 7 additions & 2 deletions android/src/main/java/com/calendarevents/CalendarEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,13 @@ private WritableNativeMap findEventInstanceById(String eventID) {
private int addEvent(String title, ReadableMap details, ReadableMap options) throws ParseException {
String dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));

boolean skipTimezone = false;
if(details.hasKey("skipAndroidTimezone") && details.getBoolean("skipAndroidTimezone")){
skipTimezone = true;
}
if(!skipTimezone){
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
}
ContentResolver cr = reactContext.getContentResolver();
ContentValues eventValues = new ContentValues();

Expand Down