|
|
#1471 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,216
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
Note: Variable names starting with underscore are not passed to the called chain. |
|
|
|
|
|
|
#1472 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 922
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
I created an action chain to collect some data.
Haha, I'm still mulling over the school library project. I have this, and it copies the data to the column, but I get this error: User: 2112 | Loan: March 29, 2025 | Return: BAD DATE Code:
program:
user = field('#user');
loan = format_date(field('#loandate'), 'dd MMM yyyy');
dev = field('#return');
if dev == '' then
return = 'no date'
else
return = format_date(dev, 'dd MMM yyyy')
fi;
'User: ' & user & ' | Loan: ' & loan & ' | Return: ' & return
loandate: date return: date |
|
|
|
|
|
#1473 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,686
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Does it happen for any book? Does it work for books with no return date?
|
|
|
|
|
|
#1474 | |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,358
Karma: 79528341
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
Last edited by ownedbycats; 04-06-2025 at 05:27 PM. |
|
|
|
|
|
|
#1475 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 922
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Following your message, I tried it and it worked fine in one, but they are all loaded the same way.
|
|
|
|
|
|
#1476 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,686
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Quote:
Code:
* ``format_date(val, format_string)`` -- format the value, which must be a date string, using the format_string, returning a string. It is best if the date is in ISO format as using other date formats often causes errors because the actual date value cannot be unambiguously determined. Note that the ``format_date_field()`` function is both faster and more reliable. |
|
|
|
|
|
|
#1477 | |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 922
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Quote:
|
|
|
|
|
|
|
#1478 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,686
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Quote:
Code:
dev = field('#return');
if dev == '' then
return = 'no date'
else
return = format_date_field('#return', 'dd MMM yyyy')
fi;
|
|
|
|
|
|
|
#1479 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 922
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Now yes! Many thanks to ownedbycats and Terisa de Morgan
|
|
|
|
|
|
#1480 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,358
Karma: 79528341
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question: I have datetime formatted as MMM d yyyy. How do I set a predefined date with specific time?
|
|
|
|
|
|
#1481 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: d = "20250421T13:42:01"; 'The date and time are ' & format_date(d, "MMM d yyyy hh:mm:ss ap") Code:
The date and time are Apr 21 2025 01:42:01 pm |
|
|
|
|
|
|
#1482 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,358
Karma: 79528341
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Thanks. Will set on local timezone, or UTC?
|
|
|
|
|
|
#1483 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
It is local time (actually, time naive). Example:
Code:
program: d = "20250421T13:42:01"; 'The date and time are ' & format_date(d, "iso") Code:
The date and time are 2025-04-21T13:42:01+01:00 Code:
program: d = "20250421T13:42:01Z"; 'The date and time are ' & format_date(d, "iso") Code:
The date and time are 2025-04-21T14:42:01+01:00 |
|
|
|
|
|
#1484 |
|
Member
![]() Posts: 11
Karma: 10
Join Date: Jun 2024
Device: Koba Aura
|
Hi,
I have no experience with python, and I am looking for a module, that I can import as an event, that triggers every time you send an ebook to the device. Secondly also one for when you remove a book from the device. Target is, to automatically add / remove a tag (currentlyReading) from the books on the corresponding action. I am currently using a workaround, where I made a chain for send/del, which I can manually select instaed of the normal buttons. thanks in advance for any help. |
|
|
|
|
|
#1485 |
|
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,681
Karma: 7908443
Join Date: Sep 2020
Device: none
|
Found an issue when using Spanish as UI language:
The View (open book) action gives "Menu entry: View (plugin_name: View) cannot be found" I've only recently started looking at how translation works in Calibre plugins, but I guess that would be a missing translation in es.po from: Code:
#: /__w/calibre/calibre/src/calibre/gui2/actions/view.py:51 msgid "View" msgstr "Mostrar" |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Action Chains Resources | capink | Plugins | 80 | 09-18-2025 05:45 AM |
| [Editor Plugin] Editor Chains | capink | Plugins | 106 | 06-17-2025 06:36 PM |
| [GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 04:15 PM |
| [GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 06:25 AM |