Skip to content

Commit

Permalink
1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Tazman Reinier committed Oct 25, 2023
1 parent 0385e2a commit a0be518
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 18 deletions.
25 changes: 21 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Roadmap

## Planned
- Add support for [ICS Timezones](https://github.com/joshuatazrein/obsidian-time-ruler/issues/65)
- Add support for [ICS Calendar repeats](https://github.com/joshuatazrein/obsidian-time-ruler/issues/50)
- Add support for [task repeats](https://github.com/joshuatazrein/obsidian-time-ruler/issues/5#issuecomment-1646958839)
- out how to close window when fullscreen in mobile
- no autoscroll in mobile
- can't click on untitled tasks
- make page headings create pages inside

## Considering
- Better Completed Tasks - [Weekly Review](https://github.com/joshuatazrein/obsidian-time-ruler/issues/62?notification_referrer_id=NT_kwDOBQ8O87M3ODg1NjIyNTg3Ojg0ODcyOTQ3#issuecomment-1742924623)
Expand All @@ -13,11 +16,25 @@

# Changelog

## 1.5.1 (10/22)
## 1.5.2 (10/25/2023)

**Added:**
- Support for [ICS Timezones](https://github.com/joshuatazrein/obsidian-time-ruler/issues/65)

**Fixed:**
- Error with default Dataview queries being [incorrect](https://github.com/joshuatazrein/obsidian-time-ruler/issues/71)

## 1.5.1 (10/22/2023)

**Added:**
- Add bulk edits for task times
- Fixed [bug with lengths](https://github.com/joshuatazrein/obsidian-time-ruler/issues/68#event-10732474581)

**Fixed:**
- [Bug with lengths](https://github.com/joshuatazrein/obsidian-time-ruler/issues/68#event-10732474581)
- Preserve [due times](https://github.com/joshuatazrein/obsidian-time-ruler/issues/66#issuecomment-1753184899)
- Optimize [performance](https://github.com/joshuatazrein/obsidian-time-ruler/issues/48): now only changed files are loaded in.

**Improved:**
- Optimized [performance](https://github.com/joshuatazrein/obsidian-time-ruler/issues/48): now only changed files are loaded in.

## 1.5.0 (10/08/2023)
**Added:**
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "time-ruler",
"name": "Time Ruler",
"version": "1.5.1",
"version": "1.5.2",
"minAppVersion": "0.15.0",
"description": "A drag-and-drop time ruler combining the best of a task list and a calendar view (integrates with Tasks, Full Calendar, and Dataview).",
"author": "Joshua Tazman Reinier",
Expand Down
15 changes: 8 additions & 7 deletions src/services/calendarApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { Component, Notice, request } from 'obsidian'
import { setters } from '../app/store'
import TimeRulerPlugin from '../main'

const WEBCAL = 'webcal'

export default class CalendarAPI extends Component {
settings: TimeRulerPlugin['settings']
removeCalendar: (calendar: string) => void
Expand All @@ -25,13 +23,13 @@ export default class CalendarAPI extends Component {
const events = {}
const now = new Date()
let i = 0

await Promise.all(
this.settings.calendars.map(async (calendar) => {
try {
const data = await request(calendar)
const icsEvents = ical.parseICS(data)
const calendarName = data.match(/CALNAME:(.*)/)?.[1] ?? 'Default'

for (let [id, event] of _.entries(icsEvents)) {
if (
!event.start ||
Expand All @@ -41,19 +39,22 @@ export default class CalendarAPI extends Component {
)
continue

let start = DateTime.fromJSDate(event.start).setZone('local')
let end = DateTime.fromJSDate(event.end).setZone('local')

const startString = (
event.start['dateOnly']
? DateTime.fromJSDate(event.start).toISODate()
: DateTime.fromJSDate(event.start).toISO({
? start.toISODate()
: start.toISO({
suppressMilliseconds: true,
suppressSeconds: true,
includeOffset: false,
})
) as string
const endString = (
event.start['dateOnly']
? DateTime.fromJSDate(event.end).toISODate()
: DateTime.fromJSDate(event.end).toISO({
? end.toISODate()
: end.toISO({
suppressMilliseconds: true,
suppressSeconds: true,
includeOffset: false,
Expand Down
3 changes: 1 addition & 2 deletions src/services/obsidianApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export default class ObsidianAPI extends Component {

loadTasks(path: string) {
if (!dv.index.initialized) {
console.log('not initialized')
return
}

Expand All @@ -91,7 +90,7 @@ export default class ObsidianAPI extends Component {
let pageSearch: DataArray<Record<string, Literal> & { file: PageMetadata }>
try {
let basicSearch = dv.pages(
`"${path.replace(/"/g, '\\"')}" and (${this.settings.search ?? 'true'})`
`"${path.replace(/"/g, '\\"')}" and (${this.settings.search || '""'})`
) as DataArray<Record<string, Literal> & { file: PageMetadata }>

taskSearch = (basicSearch['file']['tasks'] as DataArray<STask>).where(
Expand Down
10 changes: 6 additions & 4 deletions src/services/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,13 @@ export function textToTask(
}

const parsePriority = (): number => {
let priority = item['priority']
let priority = item['priority'] as number | string

if (typeof priority === 'number') return priority
else if (priority)
else if (typeof priority === 'string') {
priority = priority.toLowerCase()
return priorityKeyToNumber[priority] ?? TaskPriorities.DEFAULT
else {
} else {
// tasks priority
for (let emoji of [
keyToTasksEmoji.highest,
Expand Down Expand Up @@ -428,7 +429,8 @@ export function pageToTask(
path: item.file.path,
priority:
typeof item.priority === 'string'
? priorityKeyToNumber[item.priority] ?? TaskPriorities.DEFAULT
? priorityKeyToNumber[item.priority.toLowerCase()] ??
TaskPriorities.DEFAULT
: TaskPriorities.DEFAULT,
children: [],
page: true,
Expand Down

0 comments on commit a0be518

Please sign in to comment.