Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
04.04.2011, 16:06
|
|||
---|---|---|---|
|
|||
Сортировка по дате |
|||
#18+
Имеются даты в таком формате: 03.02.2011 09:32:18. Нужно отсортировать. Сортировка по text и number не подходит. ... |
|||
:
Нравится:
Не нравится:
|
|||
|
04.04.2011, 16:11
|
|||
---|---|---|---|
|
|||
Сортировка по дате |
|||
#18+
Забыла уточнить - делаю xml-шаблон. ... |
|||
:
Нравится:
Не нравится:
|
|||
|
04.04.2011, 16:54
|
|||
---|---|---|---|
Сортировка по дате |
|||
#18+
Альтаир, Навскидку, так: Код: plaintext 1. 2.
... |
|||
:
Нравится:
Не нравится:
|
|||
|
04.04.2011, 16:55
|
|||
---|---|---|---|
|
|||
Сортировка по дате |
|||
#18+
или переведи дату в формат yyyyMMddhhmmss. без пробелов и сортируй как строки ... |
|||
:
Нравится:
Не нравится:
|
|||
|
04.04.2011, 17:08
|
|||
---|---|---|---|
|
|||
Сортировка по дате |
|||
#18+
Спасибо. Сделала так: <xsl:sort select="substring(@date,7,4)" data-type="number" order="descending"/> <xsl:sort select="substring(@date,4,2)" data-type="number" order="descending"/> <xsl:sort select="substring(@date,1,2)" data-type="number" order="descending"/> <xsl:sort select="substring(@date,12,2)" data-type="number" order="descending"/> <xsl:sort select="substring(@date,15,2)" data-type="number" order="descending"/> <xsl:sort select="substring(@date,18,2)" data-type="number" order="descending"/> ... |
|||
:
Нравится:
Не нравится:
|
|||
|
30.08.2012, 14:08
|
|||
---|---|---|---|
|
|||
Сортировка по дате |
|||
#18+
Уважаемые форумчане! расскажите пожалуйста доступно по какому принципу происходит сортировка по дате этими функциями: откуда берется значение 18? что оно означчает?? <xsl:sort select="substring(@date,7,4)" data-type="number" order="descending"/> <xsl:sort select="substring(@date,4,2)" data-type="number" order="descending"/> <xsl:sort select="substring(@date,1,2)" data-type="number" order="descending"/> <xsl:sort select="substring(@date,12,2)" data-type="number" order="descending"/> <xsl:sort select="substring(@date,15,2)" data-type="number" order="descending"/> <xsl:sort select="substring(@date,18,2)" data-type="number" order="descending"/> ... |
|||
:
Нравится:
Не нравится:
|
|||
|
30.08.2012, 14:14
|
|||
---|---|---|---|
Сортировка по дате |
|||
#18+
ткуда берется значение 18? что оно означчает??18 это номер символа в исходной строке с датой — с него начинаются секунды. ... |
|||
:
Нравится:
Не нравится:
|
|||
|
30.08.2012, 15:08
|
|||
---|---|---|---|
Сортировка по дате |
|||
#18+
mjoey, substring Function ... |
|||
:
Нравится:
Не нравится:
|
|||
|
30.08.2012, 15:21
|
|||
---|---|---|---|
|
|||
Сортировка по дате |
|||
#18+
bazile, Ребят, можно ВАС попросить помочь сделать сортировку по дате? неделю бьюсь.. есть xsl шаблон и приходящий xml. ... |
|||
:
Нравится:
Не нравится:
|
|||
|
30.08.2012, 16:06
|
|||
---|---|---|---|
|
|||
Сортировка по дате |
|||
#18+
как для элемента item сделать сортировку по дате <?xml version="1.0" encoding="UTF-8"?> <document> <site_user_id>0</site_user_id> <ОтображатьСсылкуНаАрхив>0</ОтображатьСсылкуНаАрхив> <ОтображатьСсылкиНаСледующиеСтраницы>0</ОтображатьСсылкиНаСледующиеСтраницы> <blocks id="21"> <name>Хоккей. Новости</name> <description><img src="/images/tpl/hockey1616.png" alt="Хоккей" height="16" width="16" /></description> <url>/hockey/</url> <access>0</access> <parent_group_id>0</parent_group_id> <count_items>2</count_items> <count_all_items>283</count_all_items> <count_groups>3</count_groups> <count_all_groups>3</count_all_groups> <count_items_on_page>10</count_items_on_page> <group id="49" parent_id="0"> <site_user>0</site_user> <name>Еврохоккейтур</name> <description>euro-hockey-tour</description> <order>0</order> <path>news-euro-hockey-tour</path> <fullpath>news-euro-hockey-tour/</fullpath> <access>-1</access> <activity>1</activity> <count_items>23</count_items> <count_all_items>23</count_all_items> <count_groups>0</count_groups> <count_all_groups>0</count_all_groups> <allow_indexation>1</allow_indexation> <seo_keywords>Еврохоккейтур</seo_keywords> <propertys> <property type="String" xml_name="url" id="7" parent_id="0" value_id="24"> <name>url группы</name> <value>euro-hockey-tour</value> <default_value></default_value> <order>0</order> </property> </propertys> </group> <group id="12" parent_id="0"> <site_user>0</site_user> <name>КХЛ</name> <description>khl</description> <order>0</order> <path>khl-news</path> <fullpath>khl-news/</fullpath> <access>-1</access> <activity>1</activity> <count_items>224</count_items> <count_all_items>224</count_all_items> <count_groups>0</count_groups> <count_all_groups>0</count_all_groups> <allow_indexation>1</allow_indexation> <propertys> <property type="String" xml_name="url" id="7" parent_id="0" value_id="22"> <name>url группы</name> <value>khl</value> <default_value></default_value> <order>0</order> </property> </propertys> </group> <group id="14" parent_id="0"> <site_user>0</site_user> <name>Чемпионат мира</name> <description>world-championship</description> <order>0</order> <path>wc-news</path> <fullpath>wc-news/</fullpath> <access>-1</access> <activity>1</activity> <count_items>34</count_items> <count_all_items>34</count_all_items> <count_groups>0</count_groups> <count_all_groups>0</count_all_groups> <allow_indexation>1</allow_indexation> <seo_keywords>Чемпионат мира</seo_keywords> <propertys> <property type="String" xml_name="url" id="7" parent_id="0" value_id="23"> <name>url группы</name> <value>world-championship</value> <default_value></default_value> <order>0</order> </property> </propertys> </group> <items> <count_items>283</count_items> <current_page>0</current_page> <items_on_page>5</items_on_page> <item id="1832" group_id="12"> <item_date>28.08.2012</item_date> <item_datetime>28.08.2012 21:34:00</item_datetime> <item_time>21:34:00</item_time> <item_putoff_date>00.00.0000 00:00:00</item_putoff_date> <item_putend_date>00.00.0000 00:00:00</item_putend_date> <item_name>КХЛ открывает сезон</item_name> <item_description><p>4 сентября 2012 года откроется новый сезон Континентальной хоккейной лиги. В новом сезоне будут играть 26 команд<span style="margin-right: 0.3em"> </span> <span style="margin-left: -0.3em">(14</span> — в западной конференции, 12 — в восточной).<i> </i></p></item_description> <part count="1">0</part> <item_text><p>4 сентября 2012 года откроется новый сезон Континентальной хоккейной лиги.</p> <p>В новом сезоне будут играть 26 команд<span style="margin-right: 0.3em"> </span> <span style="margin-left: -0.3em">(14</span> — в западной конференции, 12 — в восточной). Хоккейные клубы проведут 52 матча: по два раза друг с другом, а также по два дополнительных матча. Чемпионат продлится до 17 февраля. После этого клубы сразятся за Кубок Гагарина.</p> <p>Стартом к открытию Регулярного чемпионата послужит матча открытия, который пройдёт в Москве.</p> <p>За<span style="margin-right: 0.3em"> </span> <span style="margin-left: -0.3em">«</span>Кубок „Локомотива“ поборются московское<span style="margin-right: 0.3em"> </span> <span style="margin-left: -0.3em">«</span>Динамо» и<span style="margin-right: 0.3em"> </span> <span style="margin-left: -0.3em">«</span>Авангард» из Омска. Напомним, динамовцы стали чемпионами, а хоккеисты<span style="margin-right: 0.3em"> </span> <span style="margin-left: -0.3em">«</span>Авангарда» вошли в финал Кубка Гагарина в 2012 году.</p> <p style="padding-left: 180px;"><i>Кубок получил своё название взамен старому –<span style="margin-right: 0.3em"> </span> <span style="margin-left: -0.3em">«</span>Кубок Открытия» – в память о ярославской команде, разбившейся 7 сентября 2011 года в авиакатастрофе. </i></p></item_text> <item_image width="165" height="137">/upload/information_system_21/1/8/3/item_1832/information_items_1832.jpg</item_image> <item_small_image width="100" height="83">/upload/information_system_21/1/8/3/item_1832/small_information_items_1832.jpg</item_small_image> <information_items_order>0</information_items_order> <item_status>1</item_status> <item_ip>79.132.124.41</item_ip> <item_seo_title></item_seo_title> <item_seo_description></item_seo_description> <item_seo_keywords>Кубок Гагарина, "Динамо", Авангард, Динамо</item_seo_keywords> <item_access>-1</item_access> <item_path>/hockey/khl-news/kkhl-otkryvaet-sezon/</item_path> <item_path_field>kkhl-otkryvaet-sezon</item_path_field> <item_show_count>8</item_show_count> <site_user_id>0</site_user_id> <item_propertys> </item_propertys> <item_comments> <count_comments>0</count_comments> <grade_sum>0</grade_sum> <grade_count>0</grade_count> <average_grade>0</average_grade> </item_comments> </item> </items> </blocks> </document> ... |
|||
:
Нравится:
Не нравится:
|
|||
|
30.08.2012, 16:56
|
|||
---|---|---|---|
Сортировка по дате |
|||
#18+
Да тоже самое. Только вместо @date подставить item_datetime. ... |
|||
:
Нравится:
Не нравится:
|
|||
|
|
start [/forum/search_topic.php?author=fmr&author_mode=last_topics&do_search=1]: |
0ms |
get settings: |
8ms |
get forum list: |
15ms |
get settings: |
11ms |
get forum list: |
16ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
34ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
53ms |
get tp. blocked users: |
2ms |
others: | 433ms |
total: | 596ms |
0 / 0 |