Automator Service for Notes + Calendar - macos

I've been trying to figure this out for a while. Is there a way to set up a service that would parse a Note and create calendar events based on each line from that Note?
For example, say that the contents of my note are as follows:
December 1 9:00AM - 5:00PM
December 2 9:00AM - 5:00PM
December 3 11:30AM - 8:00PM
Is anyone familiar with how to parse this? I'd like to set up a service that would take those dates, and those hours and create calendar events with a default name (ex. "Work"). I'm familiar with how to do it in programming languages like Python or Swift, but I'm still new to scripting.
Any help would be appreciated. Thanks!

Related

how to get current year date and the year count by passing a date in Laravel Carbon?

I'm using Carbon, I expect two functions in my application and I hope those can be done using any Carbon methods. I tried to find it on the internet and could not find an exact answer to my question. So I'm posting it here with the hope someone might help me. Thank you.
what are the functions I expect is:
for example, an event that happened on 2014-05-15
using above date I need to find the event date from current year and how many years for the event now as below,
event from the current year - 2021-05-15
years for the event - 7 years
is there a possible way to do these using any Carbon inbuilt functions?
(I expect this function to a big process in my code and here it's a simple example what should happen)
Use Carbon::diffInYears
$date = Carbon::parse('2021-05-15');
$diffYears = Carbon::now()->diffInYears($date);
Refer Carbon doc for more diff methods https://carbon.nesbot.com/docs/#api-difference

Calendar library customisation advice

CodeIgniter has a nice calendar library, but my calendar requirements are a little specific. I would need to display only calendar dates for a range of specific days. For example, Mondays, or Mondays and Fridays, or just weekdays.
For example, Mondays for this month would look like;
<< Mondays in April >>
[4] [11] [18] [25]
I've read the docs and looked at some tutorials, but haven't learned how to do this myself.
Does anyone have any ideas about how to do this with the existing calendar library, or would it be better to build something like this from scratch?
Thanks.
You could use your own made template and extend Calendar class, but It would be troublesome. I think Codeigniter doesn't have the right tool straight of the box for your situation. I would propose calendR. I would parse desired month and took f.e. mondays using API, especially CalendR\Period\Day which has constant MONDAY.

How to disable dates before today in DatePicker tool in Windows Phone? [duplicate]

First of, is there any real documentation of the toolkit ? What I would like is to specify a range of selectable dates. For example I don't want to display dates before today. If the user select a start date of Jan. 27th 2012, I want to allow only dates after these for the return date
Documentation is a little bit sparse for the toolkit - your best bet is to look in the source of the sample app but they don't cover all the scenarios.
The default control doesn't seem to support a minimum or maximum value for the selected date, but if you download the source you should be able to modify it according to your needs. The layout of the source is pretty straightforward and you should be able to find an acceptable place to add the code, the only thing you need to decide is how you handle it from a UI perspective. In my opinion, you are better off handling the range check once the control returns - if it is an invalid date, pop up a message and re-show the control.
I've found that in the absence of documentation, the WindowsPhoneGeek blog (in this specific case see link here) usually does a good job of explaining the Silverlight Toolkit components in their various articles.
These articles can be a great help when following ZombieSheep's advice of taking a look at the toolkit sample code.

Limit date range in a DatePicker

First of, is there any real documentation of the toolkit ? What I would like is to specify a range of selectable dates. For example I don't want to display dates before today. If the user select a start date of Jan. 27th 2012, I want to allow only dates after these for the return date
Documentation is a little bit sparse for the toolkit - your best bet is to look in the source of the sample app but they don't cover all the scenarios.
The default control doesn't seem to support a minimum or maximum value for the selected date, but if you download the source you should be able to modify it according to your needs. The layout of the source is pretty straightforward and you should be able to find an acceptable place to add the code, the only thing you need to decide is how you handle it from a UI perspective. In my opinion, you are better off handling the range check once the control returns - if it is an invalid date, pop up a message and re-show the control.
I've found that in the absence of documentation, the WindowsPhoneGeek blog (in this specific case see link here) usually does a good job of explaining the Silverlight Toolkit components in their various articles.
These articles can be a great help when following ZombieSheep's advice of taking a look at the toolkit sample code.

indian calendar needed

I want a 100 years calendar which shows certain Indian special days like Amavasya and Poornima.
I want to find the day for Poornima or Amavasya for example - in the year 1936. When was Shivratri aur janmasthami. I want to find day according to these specifications.
If there is a program that can do this, please let me know.
Thank you.
The amavasya and poornima (New Moon and Full Moon) are calculated based on a complex formula defined in below wiki. You can try developing a small program out of that. :-)

Resources