Fictitious Calendar - How to create one?

Hello everyone!

I have recently started using gramps to keep track of the characters in my fiction. It has helped me tremendously not to overlook certain key aspects and has allowed me to visualize relationships - so thank you for providing the program!

I would like to implement a fake/fictitious calendar. (Ideally more than one with different days per year but I have been working with an “author calendar” so far and just that would already be sublime!)

From research on the internet I know that it is possible. I read about someone who wanted to play around woth GoT characters and someone blogged in 2016 about how it was possible but required a good understanding of python. Which I do not have.

Could anyone please point me in the right direction? What file would have to be edited? What programming language is required or where can I learn enough to make these changes? Is there perhaps some sort of documentation from others who have tried in the past?

I use gramps 4.2.2 on Ubuntu/Linux
The calendar I would like would have 375 days in 15months.

Thank you so much for any reply

Probably involves coding a new data handler for Gramps ?

Wow Gramps 4.2.2 released 2016-01-06 (version 4.2.8 was the last of that unsupported series) !

Thank you for replying. I followed the link and looked over it quickly. It seems complex and I will devote more time to it later. But I gather that the key is the serial date number.

I understand this to mean that say March 31st of 2023 is in fact say day 10.000 and March 21st of 2023 would be day 9.990. Now if I want to display March 31st as Gwendolyn 12 and March 21st as Gwendolyn 2 then the program would convert back and forth. Is this the logoc behind it?

As for gramps itself - you recommend a newer version? I will look into that as well. Thank you.

1 Like

Welcome

There is a holidays.xml file in the program folder \share\gramps. It is used by the Web Calendar report (menu >> Web Pages).

Easily edited to show holidays and events. The Web Calendar allows you to specify a span of years.

All dates in Gramps are internally converted to Modified Julian Date so that they can be compared no matter the calendar (Gregorian, Julian, Hebrew, Islamic, Persian, French Republican, Swedish). This is done in file gramps/gen/lib/gcalendar.py. Look at the xxx_sdn functions (sdn = Serial Date Number).

Be cautious, though. There is an undocumented trick to make computations easier. As an intermediate step, all years are offset to start on March 1st so that any year is made of 2 identical 5-month sequences followed by 2 “anomalous” months. Of course an inverse offset is applied at end.

You can add your own calendar by writing two conversions methods (to/from Julian).

You also need to write a date parser (gramps/gen/datehandler/_dateparser.py) so that what you type can be passed to the date conversion methods from what is entered with the GUI. You perhaps also need a date formatter (gramps/gen/datehandler/_datedisplay.py) to output an internal date in human-readable form, though the Date object keeps the original year, month, day elements in some fields. This supposes your fictitious calendar has the same structure: 3 components equivalent to year, month and day.

The other _date_xx.py files in gramps/gen/datehandler/ are for localisation. If you’re using the US version of Gramps, you won’t need them.

As already mentioned by others, Gramps is written in Python. The link provided by @anon9092048 is about date localisation in languages other than en_US.

My recommendation would be to study first Gramps code. For that, download Gramps source and install LXR (click on the SourceForge logo to access the download service). It will allow you to browse the code with your usual browser. Identifiers are clickable and give you access to cross-references and you can jump quickly to these references.

Documentation for Python is available here. Note these aren’t tutorials so you need intellectual effort to link with your own questions about the code.

Try to integrate with the present data management. Don’t attempt to design your own GUI dialogs. This is possible is you stick with the Y-M-D paradigm which is presently the basis of all dates in Gramps. If you really want to create your own dialogs, you’ll be faced with a tremendous task needing to understand control flow inside Gramps. This is daunting task. Gramps uses GTK+ widgets and relies heavily on “signals and slots”. You’ll find GTK3 general documentation here. This is absolute no tutorial and is of any help if you already have any notion about GTK+.

Thanks! That will likely be a step down the line because my fantasy world will have fantasy holidays :slight_smile:

Perfect! Although very complex this, I believe, is what I was looking for. When I get a chance I will look into this but I can already say that the year - month - day system works without a hitch for my “author year”. I will stick with that for all things gramps.

I hope I can do without the source code as I feel that might be a little too daunting. In any case you have given me much to work with and I will be busy for the next few weeks :smiley: thank you so much for taking the effort and linking all this.

As soon as I figured it all out I will mark your answer as the solution.

Keeping track of characters… and whether different character’s paths could cross… seems like a good fit for Gramps.

But the 375 days calendar might prove challenging.

Is the calendar a critical factor in the plot? (As in Anne McCaffrey’s dragonriders of Pern series where the orbital mechanics controlled threadfall.)

Some Fantasy/SciFi authors fall into the trap of extravagant differences from earth that add complexity without enriching the story. Then, if they manage to sell their story, much of that falls victim to the editor’s relentless red pen.

I have a lot of difficulty composing a reply here. There are different ways to see your post.

Did you mean 375 days is challenging with regards to the sdn and gramps?

Did you mean to share with me/us your knowledge of writing and give advice on that?

I mean ‘challenging’ in several ways.

Obviously there is the challenge of coding a sysytem that will map the internally stored date value from to a new year length and number of months. Partl of the challenge is because nobody ELSE is likely to want a calendar with 375 days and 15 months.

So either you will have to attract a coder to do your specific calendar, or, convince someone there is good value in building a complex tool that allows a settable year configuration.

So questioning the plotline ‘value’ for a custom calendar is the first step. After that, you can decide how much you’re willing to put into getting such a feature.

Did you read my original question? Here’s an interesting part:

As for

I have clearly already done that:

And

To summarize I already said:

In response to @pgerlier

So, to my mind, the question asked was answered.

I did read your original message and also considered the other replies… by other volunteers and your responses to them.

Gramps is entirely in Python. But you said that “required a good understanding of Python. Which I do not have.” So I made the leap that you were going to have to attract a developer to help. (I am not a coder either. But I am learning slowly.) Or you were going to have to re-assess the necessity/cost.

The existing development “tutorials” are written for experienced Python coders and assume Linux OS. The Date Handler wiki page certainly is not introductory. Since all the previous date handlers have been designed the lunar annual cycle of earth, that still leaves the huge leap to a fictitious another year length and number of months.

It just seems unlikely that only an experienced Python programmer could do this without finding a volunteer to help code it.

As for:

I read those as preliminary: “research on the internet”, “hope” and “might”

I’m not trying to be difficult. There is not a straight answer, just tradeoffs. You have not clearly stated what you intend to do (what you wanted WAS clear and specific), nor that you had made a decision. People will continue to chime in with suggestions, requests for clarification until you not only say enough but also tell us your decision. (Or the thread automatically closes in 30 days.)

From my side, I was trying to give you MORE than enough information to make your own decision. Please try to appreciate that we volunteers are making a significant effort to fully explore your question and answer.

Neither am I trying to be difficult. I have the utmost respect for what you are doing for/with/around gramps and I deeply appreciate the privilege of being able to use the program for free.

I merely got the impression that you were telling me not to even try which I found upsetting and disheartening. From what I understand about genealogy research that was a surprising reaction and caught me off guard.

I was very grateful to @pgerlier (and all others who posted and so quickly too!) for their reply which seemed to be both comprehensive and helpful and certainly took a while to compose. As I am severely restricted in terms of time I did not want to wait until I had the opportunity to try my hand at all this before declaring the answer the solution so I tried saying: I do consider it answered, will flag it down the road.

So, if you are asking if you can close the thread: yes, I am okay with that. I will likely have to work hard to get what I want but then I find that those undertakings end up being the most rewarding.

1 Like

Actually, I am more interested in what you decided to do.

If you decided to workaround the existing calendar abilities, that is fine. We aren’t fanatics about ‘closing’ a thread. But if someone starts working on calendars, we’ll try to remind them that you are interested.

If you decided to try working on the code, we could try to find a few people at a similar level who might like to collaborate. And someone else who would be willing to answer a few questions. (The usual starting point for people starting with gramps code are: writing add-on reports & gramplets; or, learning to apply patches from the developmental fork of Gramps. A new date handler is a lot deeper than those.)

If you decided to hire someone to code a date handler, THAT would be a whole new experience in our community. I’ve only heard of one Gramps user contracting such a thing, then he didn’t share afterwards. (The Isotammi group has a team doing features for a Gramps fork for the Finnish Genealogical Society… but I don’t know how they are organized.)

I’m not sure what that means, so please excuse me if the following suggestion is not helpful.

Gramps allows you to enter anything you want in the Date field. Although it will highlight entries that are not valid dates in the calendars it knows, it will still save the text.

So, you could enter all of your fictitious dates as text. In the Events view, you could sort by the Date column and it would sort according to the text, so you would probably want to format the text as year-month-day, for example ‘0100-05-07’ for the 7th day of the 5th month of the 100th year. (The leading zeroes are essential for correct sorting.)

If you want the month names to appear, you could type the text as ‘0100-05xxx-07’ where ‘xxx’ if the name of the fifth month. If the alphabetical order of your months happens to correspond with the chronological order, then you could omit the ‘05’.

1 Like

I will definitely not hire anyone. I will give it a shot, see what I can do on my own. Though I plan on giving myself a lot of time. I find I usually work on an aspect, get side tracked with another and eventually find my way back several weeks or months later. If the endeavour should prove too time consuming to be worth while I would resort to simply using years as dates and forego the detail of months and days.

That would be a shame because so many useful tools are in gramps from marriages, to events and so on that I would love to see in a timeline - something I have been after for ages. But if it won’t work I will find another tool for it. Ultimately my main priority is the writing. But I am happy to keep you posted.

1 Like

That is… beautiful! I will try that as well. I assume I will run into issues with things like “Are these people alive at the same time?” kind of questions but I might just get away with it…

What do you think?

The original “author year” was referring to something else. As I write a fantasy novel different races have different numbering ways similar to the gregorian calendar and others. For my own sanity I made a “master” one that I convert from when a character mentions a date. Does that make sense?

If I had found it super easy to alter the calendar (which it clearly is not) I would have put all those into gramps and gotten rid of my excel sheet :wink:

Even with dates that Gramps understands, that particular question is tricky. See this thread.

But, if you use the text-based dates, then I think all you would need to do is code a (relatively) simple custom filter rule that would look for dates (as text strings) that are “between” two given input strings.

In fact, I think such a rule for normal dates would help with the issue in the thread linked above.

I don’t think so. There are already calendars with non-365/6 days in Gramps, e.g. Islamic. From a given Y-M-D, you compute a serial number (SDN). All present Gramps calendar do this, so that you can compare “2 ventôse an VII” and “July 4th, 1776” or “3 safar 1234”.
All there is to do is to write the conversion from fictitious Y-M-D to SDN and back for display.
Since this is a fictitious calendar, probably not related to our Gregorian one, it is not really important to align it on some date of our calendar. Any “fictitious” origin can be chosen for SDN 0. Then all events recorded in Gramps use this SDN.

If I understand right, to make the narrative more “epic”, the fictitious universe has several races, each with its own calendar. This is no difficulty in Gramps. You just define several calendars, each computing an SDN. You can then compare dates of events in different calendars and tell whether one occurred before the other.

1 Like

Cool! Thank you for the link. I realize I am only at the very beginning of discovering what gramps can do and how to ask the right questions.