{"id":18643629,"url":"https://github.com/lemberg/carma-date","last_synced_at":"2025-04-11T12:30:46.003Z","repository":{"id":13480766,"uuid":"16171016","full_name":"lemberg/carma-date","owner":"lemberg","description":"Patched Date module for C@rma project","archived":true,"fork":false,"pushed_at":"2014-01-23T12:24:18.000Z","size":6460,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"7.x-2.x","last_synced_at":"2025-02-18T09:40:42.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lemberg.png","metadata":{"files":{"readme":"README.txt","changelog":"CHANGELOG.txt","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-23T11:51:17.000Z","updated_at":"2023-09-26T07:57:03.000Z","dependencies_parsed_at":"2022-09-05T01:40:26.927Z","dependency_job_id":null,"html_url":"https://github.com/lemberg/carma-date","commit_stats":null,"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemberg%2Fcarma-date","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemberg%2Fcarma-date/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemberg%2Fcarma-date/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemberg%2Fcarma-date/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lemberg","download_url":"https://codeload.github.com/lemberg/carma-date/tar.gz/refs/heads/7.x-2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401924,"owners_count":21097328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T06:07:35.996Z","updated_at":"2025-04-11T12:30:45.532Z","avatar_url":"https://github.com/lemberg.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"INFORMATION FOR DEVELOPERS\n\nOnce the Date API is installed, all functions in the API are available to be\nused anywhere by any module.\n\nThe API uses the PHP 5.2 date functions to create and manipulate dates.\n\nExample, the following will create a date for the local value in one\ntimezone, adjust it to a different timezone, then return the offset in seconds\nin the new timezone for the input date; The offset will be adjusted for both\nthe timezone difference and daylight savings time, if necessary:\n\n$date = date_create('2007-03-11 02:00:00', timezone_open('America/Chicago'));\n$chicago_time = date_format($date, 'Y-m-d H:i');\n\nprint 'At '. $chicago_time .' in Chicago, the timezone offset in seconds\n  was '. date_offset_get($date);\n\ndate_timezone_set($date, timezone_open('Europe/Berlin');\n$berlin_time = date_format($date, 'Y-m-d H:i');\n\nprint 'It was '. $berlin_time .' in Berlin when it\n  was '. $chicago_time .' in Chicago.';\nprint 'At that time in Berlin, the timezone offset in seconds was\n  '. date_offset_get($date);\n\nA helper class is available, new DateObject($string, $timezone, $format), where\n$string is a unixtimestamp, an ISO date, or a string like YYYY-MM-DD HH:MM:SS,\n$timezone is the name of the timezone this date is in, and $format is the format\nof date it is (DATE_FORMAT_UNIX, DATE_FORMAT_ISO, or DATE_FORMAT_DATETIME). It\ncreates and return a date object set to the right date and timezone.\n\nSimpletest tests for these functions are included in the package.\n\nAvailable functions include the following (more documentation is provided in\nthe files):\n\n============================================================================\nPreconfigured arrays\n============================================================================\nBoth translated and untranslated values are available. The\ndate_week_days_ordered() function will shift an array of week day names so it\nstarts with the site's first day of the week, otherwise the weekday names start\nwith Sunday as the first value, which is the expected order for many php and sql\nfunctions.\n\ndate_month_names();\ndate_month_names_abbr();\ndate_month_names_untranslated();\ndate_week_days();\ndate_week_days_abbr();\ndate_week_days_untranslated();\ndate_week_days_ordered();\ndate_years();\ndate_hours();\ndate_minutes();\ndate_seconds();\ndate_timezone_names();\ndate_ampm();\n\n============================================================================\nMiscellaneous date manipulation functions\n============================================================================\nPre-defined constants and functions that will handle pre-1970 and post-2038\ndates in both PHP 4 and PHP 5, in any OS. Dates can be converted from one\ntype to another and date parts can be extracted from any date type.\n\nDATE_DATETIME\nDATE_ISO\nDATE_UNIX\nDATE_ARRAY\nDATE_OBJECT\nDATE_ICAL\n\ndate_convert()\ndate_is_valid();\ndate_part_is_valid();\ndate_part_extract();\n\n============================================================================\nDate calculation and navigation\n============================================================================\ndate_difference() will find the time difference between any two days, measured\nin seconds, minutes, hours, days, months, weeks, or years.\n\ndate_days_in_month();\ndate_days_in_year();\ndate_weeks_in_year();\ndate_last_day_of_month();\ndate_day_of_week();\ndate_day_of_week_name();\ndate_difference();\n\n============================================================================\nDate regex and format helpers\n============================================================================\nPre-defined constants, an array of date format strings and their\nequivalent regex strings.\n\nDATE_REGEX_LOOSE is a very loose regex that will pull date parts out\nof an ISO date with or without separators, using either 'T' or a space\nto separate date and time, and with or without time.\n\ndate_format_date() is similar to format_date(), except it takes a\ndate object instead of a timestamp as the first parameter.\n\nDATE_FORMAT_ISO\nDATE_FORMAT_DATETIME\nDATE_FORMAT_UNIX\nDATE_FORMAT_ICAL\n\nDATE_REGEX_ISO\nDATE_REGEX_DATETIME\nDATE_REGEX_LOOSE\n\ndate_format_date();\ndate_short_formats();\ndate_medium_formats();\ndate_long_formats();\ndate_format_patterns();\n\n============================================================================\nStandardized ical parser and creator\n============================================================================\nThe iCal parser is found in date_api_ical.inc, which is not included by default.\nInclude that file if you want to use these functions:\n\nComplete rewrite of ical imports to parse vevents, vlocations, valarms,\nand all kinds of timezone options and repeat rules for ical imports.\nThe function now sticks to parsing the ical into an array that can be used\nin various ways. It no longer trys to convert timezones while parsing,\ninstead a date_ical_date_format() function is provided that can be used to\nconvert from the ical timezone to whatever timezone is desired in the\nresults. Repeat rules are parsed into an array which other modules can\nmanipulate however they like to create additional events from the results.\n\ndate_ical_export();\ndate_ical_import();\ndate_ical_date_format();\n\n============================================================================\nHelpers for portable date SQL\n============================================================================\nThe SQL functions are found in date_api_sql.inc, which is not included by\ndefault. Include that file if you want to use these functions:\n\ndate_sql();\ndate_server_zone_adj();\ndate_sql_concat();\ndate_sql_pad();\n\n============================================================================\nDate forms and validators\n============================================================================\nReusable, configurable, self-validating FAPI date elements are found in\ndate_api_elements.inc, which is not included by default. Include it\nif you want to use these elements. To use them, create a form element\nand set the '#type' to one of the following:\n\ndate_select\n The date_select element will create a collection of form elements, with a\n separate select or textfield for each date part. The whole collection will\n get reformatted back into a date value of the requested type during validation.\n\ndate_text\n The date_text element will create a textfield that can contain a whole\n date or any part of a date as text. The user input value will be re-formatted\n back into a date value of the requested type during validation.\n\ndate_timezone\n The date_timezone element will create a drop-down selector to pick a\n timezone name.\n\nThe custom date elements require a few other pieces of information to work\ncorrectly, like #date_format and #date_type. See the internal documentation\nfor more information.\n\n============================================================================\nDate Popup Module\n============================================================================\n\nA new module is included in the package that will enable a popup jQuery\ncalendar date picker and timepicker in date and time fields.\n\nIt is implemented as a custom form element, so set '#type' to 'date_popup'\nto use this element. See the internal documentation for more information.\n\n============================================================================\nDate Repeat API\n============================================================================\n\nAn API for repeating dates is available if installed. It can be used by\nother modules to create a form element that will allow users to select\nrepeat rules and store those selections in an iCal RRULE string, and a\ncalculation function that will parse the RRULE and return an array of dates\nthat match those rules. The API is implemented in the Date module as a\nnew date widget if the Date Repeat API is installed.\n\n============================================================================\nRDF Integration\n============================================================================\n\nTo make RDF easier to use, the base date themes (date_display_single and\ndate_display_range) have been expanded so they pass attributes and\nRDF mappings for the field, if any, to the theme. If RDF is installed\nand no other mappings are provided, the theme adds RDF information\nto mark both the Start and End dates as 'xsd:dateTime' datatypes with the\nproperty of 'dc:date'. This occurs in the theme preprocess layer, in\nparticular via the functions template_preprocess_date_display_single() and\ntemplate_preprocess_date_display_range().\n\nTo mark these as events instead, you could install the schemaorg\nmodule, which will load the schema.org vocabulary. The mark the content type\nthat contains events as an 'Event', using the UI exposed by that\nmodule and set the event start date field with the 'dateStart'\nproperty and tag other fields in the content type with the appropriate\nproperty types. The Date module theme will wrap the start and end\ndate output with appropriate markup.\n\nIf the result is not quite what you need, you should be able to implement your\nown theme preprocess functions, e.g. MYTHEME_preprocess_date_display_single()\nor MYTHEME_preprocess_date_display_range() and alter the attributes to use the\nvalues you want.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemberg%2Fcarma-date","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemberg%2Fcarma-date","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemberg%2Fcarma-date/lists"}