View Single Post
Old 08-01-2022, 06:45 AM   #7384
culytera
Zealot
culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.
 
Posts: 132
Karma: 295674
Join Date: Jul 2021
Device: iPhone
Back again with another question, is it possible to format the date depending on whether the date published and date updated are the same or not? For example a fic from Ao3 has a published date of January 1, 2022 and an updated date of January 2, 2022, the final date string should be January 1-2, 2022. If it's a different month, January 1-February 2, 2022. If a different year, January 1, 2021-February 2, 2022.

So far this is what I've done:
Code:
add_to_extra_valid_entries:,finalDate,publishedMonth,updatedMonth,publishedDay,updatedDay,publishedYear,updatedYear

include_in_publishedMonth:datePublished
include_in_updatedMonth:dateUpdated
include_in_publishedDay:datePublished
include_in_updatedDay:dateUpdated
include_in_publishedYear:datePublished
include_in_updatedYear:dateUpdated

publishedMonth_format:%%B
updatedMonth_format:%%B
publishedDay_format:%%d
updatedDay_format:%%d
publishedYear_format:%%Y
updatedYear_format:%%Y
But changing the format didn't work, I tried to manually change them via regex but that didn't work either.
Code:
add_to_replace_metadata:
 publishedMonth,updatedMonth=>(January|February|March|April|May|June|July|August|September|October|November|December)(\s+\d{1,2})(,\s+)(\d{4})=>\1
 publishedDay,updatedDay=>(January|February|March|April|May|June|July|August|September|October|November|December)(\s+\d{1,2})(,\s+)(\d{4})=>\2
 publishedYear,updatedYear=>(January|February|March|April|May|June|July|August|September|October|November|December)(\s+\d{1,2})(,\s+)(\d{4})=>4
Then I was thinking of comparing each published/updated month/day/year to form the final date, but I don't know if replace_metadata can take the value from other variables. Don't know why I can't just be satisfied with my current layout but here we are lol
culytera is offline   Reply With Quote