-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some additional fields #53
Comments
const APPLE_EPOCH_START = new Date("2001-01-01").getTime(); and feed the ZANNOTATIONMODIFICATIONDATE or ZANNOTATIONCREATIONDATE something like this:
where we covert as follows:
|
@jun6lee sure, you can DIY you template, please visit: https://github.com/bingryan/obsidian-ibook-plugin#for-user-defined-templates |
I'm not familiar enough with TypeScript, but what I'm after are two additional fields: I have done No.3 in my template. -- but the convertAppleTime logic I don't know the syntax to achieve in ts. last_highlight: -- which I would like to be the latest instance of ZANNOTATIONMODIFICATIONDATE and highlight_count: which would be an integer of how many highlights are imported |
@jun6lee metadata
|
Oh, didn't know it's that simple.. works! Super!!! |
Actually, it fixed formatting, but the dates are wrong. Last Highlighted: {{date annotation.ZANNOTATIONCREATIONDATE "YYYY/MM/DD HH:mm:ss "}} |
I found that the time field in ibook is similar:
|
It is Apple's Cocoas variation on EPOCH which starts from: Standard Epoch time starts from: For this reason need to add on 978307200 seconds somehow. |
@jun6lee nice job, very very very very useful information 🫡 |
@jun6lee update this plugin and try again. :)
|
Super. Does the trick. {{dateFormat ZANNOTATIONMODIFICATIONDATE "YYYY/MM/DD HH:mm:ss" }} also works... Something out of your hands, but an Apple quirk I noticed was that if I highlight on my iPhone or iPad, the modification date will only update to when the update gets uploaded to iCloud and then re-downloaded on macOS. Will have to live with that. Using below instead: Highlighted: {{dateFormat ZANNOTATIONCREATIONDATE "YYYY/MM/DD HH:mm:ss" }} |
Very cool plugin, adding some notes on improving, if it's possible.
Is there a way of getting these details in too?
last_highlight: {{latest instance of ZANNOTATIONMODIFICATIONDATE}}
highlight_count: {{number of records per book}}
If you could have a look
Highlighted: {{ZANNOTATIONMODIFICATIONDATE}}
You are pulling this, but it will needs some logic to convert it to readable data.
Looking into it, will report back.
My Template:
The text was updated successfully, but these errors were encountered: